They are enemies, but hate is too strong a word for how the series plays it. Sonic and Dr. Eggman are locked in a permanent rivalry, with Sonic repeatedly foiling the Doctor's latest scheme to conquer the world.
There is a streak of genuine respect underneath. The two are each other's most capable foil, and Eggman is often the only one who can match Sonic's speed and nerve. It is closer to a mutually exasperating contest than outright loathing, and the games occasionally lean on that for comedy.