Does the version of Minecraft affect world generation?
For example, if I use a seed to generate a world in 1.7.2 and I use the same seed to create a new world in 1.8, would both worlds be different, similar or the same?
Short answer: Yes. Quote from the Minecraft wiki's "Seed (level generation)" article:
Whenever the world generation algorithm is updated, the same seed will no longer generate the same terrain. This is why in some different versions of the game, the same seed will not give the same world.
Jeb also mentions in a blog post that "changes to the world generator [...] off-sets the world seed." He continues on mentioning they don't change the world generation algorithm often. When they do, they make significant changes.
Not every version changes the world generation. So seeds are similar within minor version updates. And it doesn't affect other assets "such as spawn location, how many items mobs drop etc". ("A Short Demystification of the 'Map Seed'").
Absolutely it does. In your example more biomes and naturally generating blocks have been added (for example red sand) in 1.8 that were not in 1.7.2. Another example is extreme coordinates in minecraft alpha and beta versions led to the Far Lands, whereas now the world generation has been changed so you can walk for 6000000 blocks until you hit the world border.