In Hogwarts Legacy, you can create your own character and the game offers you many customization options to do that. You can also try to create one of your favorite heroes, like Harry Potter (HP).
However, you can't play HP directly in the game for the simple reason that he hasn't been born yet. But, you may have already gone through the many options of your character customization in the game. You may have already thought of trying to recreate a character using customization.