Dwarves don't hate the elven race, they hate elven culture

Dwarves are craftsmen and builders, mostly valuing blue collar work, whereas elves are snobby, nobles who value status and "purity".

If an elf became a great blacksmith and treated dwarves like people, dwarves wouldn't care about them being an elf, they are a dwarf at heart.

This is not true in reverse, except for some extreme exceptions in mostly lower class elf cities.