The only source I can imagine for this (other from Tolkien's Nauglamirgate) is that on several mithologies elves and dwarven doesn't exist like modern fantasy literature depicts them, however there are several "spirits" who resemble a "primitive form" of these beings.
For example, several fairies or pixies in different mithologies seem to be related to the modern concept of elf (although there are others where the word "elf" is commonly associated with something more similar to a modern fantasy goblin :D), and the same happens with gnomes, and other "dwarvish" creatures.
So, if we try to establish something like a creature family tree on ancient mithologies we'll find that there are several creatures that resemble manners, traits and behaviours similar to those of the "modern concept" of elves, and the same happens with dwafs.
If we study in depth this two families, we'll find that the majority of those from "elvish" family are usually (not always but quite often) associated to air element, while those from the "dwarvish" family are usually associated to the earth element.
Air oposses to earth ad water does to fire.
Although not all different mithologies represent grudges or bad neighbourship between their air and earth counterparts, it's something that repeats from time to time.
So I supose that our modern concept of elves and dwarfs (and of those who wrote the stories that created that modern concept) sees quite "natural" that "air" and "earth" creatures dislikes each others.
Sincerely, I cannot say if this is enough reason to explain the usually depicted hostility between both races on modern fantasy, but seems reasonable to me.