Even some rooms are very similar - adjusted for the fact that about a hundred years have passed between the events of the game and books.
A video with a detailed comparison of locations in Hogwarts Legacy and the Harry Potter films was published by the author of the YouTube channel ElAnalistaDeBits. In the video, you can see that the developers from the studio Avalanche Software have carefully approached to recreate not only Hogwarts and its surroundings, but also rooms like the Great Hall, the Clock Tower and the director's office.
Since Hogwarts Legacy and the Harry Potter films take place at different times, some places are quite different from each other. For example, in the video you can see how the forester's hut has changed.
Some locations in the films and in Hogwarts Legacy, on the contrary, are almost the same. Among other things, this refers to the magical Gringotts Bank, founded back in 1474, hundreds of years before the events of the game and the Harry Potter books.