So, I don't know if "racist" (with the connotations that we have in our society) exactly captures the correct archetypes from standard D&D.
If you look back at ye olde racial preferences table, you'll see that the classic Gygaxian Elf modeled the idea of the haughty, proud, withdrawn elf (ahem .... Tolkien! Muahahahahahaha) that barely tolerates any race. Half elves .. fine. Everyone else, not so much.
From there, I think you get a better understanding of the antipathy between dwarves and elves in a TSR/D&D setting (classic archetype). It's clearly not racism, nor outright combat; after all, you often have elves and dwarves in the same party.
In RL terms, it's more like ... eh, fans of rival football teams in a place where it means a lot. Say, Auburn and Alabama.
Both races, being long-lived, and (again, in a classic setting) arguably past their prime and no longer dominant compared to the younger, faster-breeding and more risk-taking races, hold on to some commonalities (we are better than others) and some ideas about their differences that we can often see reflected in classic stories (city mouse, country mouse).
In short, it's not "racism," more as it is competition and ingrained performative dislike. Which varies from individual to individual.
So .... I have to admit, unless a player stresses their parentage as part of their backstory (ex. - scion of nobility looking to restore the family name, yada yada yada), it rarely comes up in campaigns.
But players are responsible for crafting their own backstories.
In my hobbit hole do I wanna stay
Dragon's hoard is real makes me wanna steal
In a hill is my house guess I'm living like a mouse
All's I gots is time Gollum's riddles tend to rhyme
Take time with Sauron's ring cause I like to steal
Take time with Sauron's ring 'cause it will conceal
Take time with Sauron's ring cause I like to steal
I like to steal
I'm half the man I used to be (a hobbit is a halfling)
Well, I'm half the man I used to be (a hobbit is a halfling)
Well, I'm half the man I used to be ((a hobbit is a halfling)
Well, I'm half the man I used to be
Half the man I used to be
So, this isn't how most people would describe this archetype. "Villagers" don't attack things that are "ugly."
People that live in areas that are under regular attack, for example, will be suspicious (or hostile) toward things that are either unfamiliar to them, or familiar as being hostile to them. But this is always context-dependent.
The easiest way to understand this archetype is to flip it; if you enter a "traditional" gnoll encampment with a primarily human party, what is the reaction likely to be?
Okay, let's take this another step. Same traditional gnoll encampment, but you have a mixed party, that includes "monstrous races" but also includes a traditional elf (not a drow). How will the gnolls react to the elf?
In other words, campaigns can (and do!) have all sorts of non-traditional, non-archetypal racial relations. But to the extent that you have some friction between various races, there will be that type of friction reflected in the party as well, and players should understand that when choosing their races- a race isn't just a grab bag of abilities, but has meaning in the world.
Of course, most settings have frontier areas and/or large cosmopolitan cities where this is less of a problem, and individuals can always gain the trust of communities.
It's not my job to reject or subvert stereotypes. I always welcome players who do that!