The problem is in this statement
In order for you to be able to hate a certain group of people, they
must fulfill two criteria:
They're within your vicinity
You have some a (real or perceived) conflict of interests with them
If you insist on limiting the only reasons for hate to those then fine.
But let me tell you than there are many many reasons for humans to hate anything other than those. If you accept this we can continue.
But I'll use hate instead of racism hate as it is somewhat more general.
Dragons used to control the world and enslaved humans. Lizards where their chosen enforcers. Humanity suffered but we did whatever we did and got the upper hand. Yet still from generation to generation we still teach our kids of the past and teach them to be avert to both or outright hate them. Sure the time scale of 4000 years or more is a bit much. But remember the last time you looked at something disgusting and did not like it? Why? Most likely because that signals disease and we don't like that. So. Even the mere sight of it is repulsive. Sure this more evolution than social engineering or selective ideas on our part. But I stand my ground. If we keep up the old tales and pass down the hatred we can keep it up as long as we want, or you want. Mentioning examples would only anger people I think.
Easy to point to religion and say here is the entire history's source of evil. But a lot of people here are writers and should show deeper understanding of humans and history.
Long story short their mere existence is a slight to us. Maybe they are creatures of darkness. Maybe the most dominant religions or ideologies are against them just because. Maybe there is even a reason. Like the dragons are the race that killed god or something like that.
Or maybe rational pure pragmatic anti religious thoughts oppose them for their obvious powers and how we can only be free only after killing them.
Honestly history is full with stories that don't even make sense. You can oppose them without reason or add reasons.
In my opinion ideology is probably the biggest and richest reason.
Maybe they release pheromones that has X effect on us. This can be as tragic as hell. For examples dragon are peaceful however they release a pheromones that they don't control, or know about, that makes us avert to them. Here you can have them be murdered for their mere existence. Depressing as hell.
This could be that people react with: disgust, fear, hatred...etc to them even without actual actions on the dragons behalf.
Another direction is that is does have a negative impact on us. Think that once exposed to dragons we are hypnotized or paralyzed or slowly go insane.
Now we can actual tangible reasons. You can control the severity. Like a bit of this and a bit of that.
They are magical. But refuse to share power or help us.
Old wise dragons hold great powers and can annihilate armies with their magic. That is why we are afraid to hunt them.
But they can also cure all diseases or change the climate or even fix mental illnesses.
Now imagine our surprise when knowing that they, together or certain members or even anyone, can snap a finger and solve all our problems but they refuse to do so.
Perhaps certain lucky heroes go there and gain a measure of power or wisdom. Perhaps they murder anyone who gets close to their lands. Whatever the thing we just hate them for not helping us.
How many 2020 people you know who think in a very scientific and logical manners?
Like what would you feel against people of ethnicity X if you meet 20 of them and they are all nice. And what would you feel about ethnicity Y if you meet 20 and all of them are awful.
Well. This is the same problem. Lizards for example are used as soldiers, criminals, bodyguards...etc and people the started viewing them with hatred.
I don't feel the need to tell that it is easy for a whole religion, culture, country...etc to be considered radical, terrorist, evil...etc just because of view bad examples. Even if that group is 2 billions, few bad examples are enough. Have the media focus on the bad ones and people will say: I don't know. I never meet a good person from that group. Even if they met like one and he was buying stuff from their stores.
Just the news or continuing browsing different sites.
Anyway if the examples known to people are those hardened cases who are criminals or violent then expect a lot of people to dislike them.
Even without direct conflict with them
In contrast to the first option this one is about seeing a few active bad examples and deciding they are all evil. While the first one is about keeping the ancient feud alive even if the last 10 generations of your family never saw a dragon.
Fear of having another intelligent species sharing the planet with us.
A lot more interesting and certainly something we never faced. But we do have legitimate concerns if we saw a race of smart creatures that can even use technology. After all we have caused so much damage to the entire planet, a lot of which is by pure accident or not caring, and life that if they are anything like us we might want to arm those ICBM and keep the default targets their lands
You can simply pick whatever elements you feel like. None comes together