It is precisely through the divorcing quality of fantasy, by creating an ideology that exists only in a different world, yet bearing similarities to our own ideologies, that allows us to see the extent of racism’s arbitrary nature. However, the opposite is not true in regards to the Muggle and Wizard divisions as possibly encouraging racist ideology.
It is important to remember that the Muggle and Wizarding worlds exist separately from each other much like two counties adjacent to one another, which is an inherent part of the Wainscott genre (the larger world needs to be ignorant of the magical sub-culture world living among or beside them). The Muggles live their everyday lives completely ignorant of the Wizarding World for the most part. The story never claims that Muggles are inferior to Wizards, at least not from the perspective of the heroes, only from the viewpoint of characters we are meant to despise. The Wizarding World and Muggles are merely different, not inferior or superior; this I think is the position of the story, and likewise, is present more for the sake of telling a fantasy story in the Wainscot tradition than serving as any effectual commentary on our society. After all, in real life there are no Wizards. These distinctions are merely conveniences of the genre, for the story’s sake, and most readers will recognize that instead of reading a particular theme of racial inferiority into it.
After all, the readers of the books are all Muggles. It is ridiculous to think that readers will identify Muggles as inferior and bad when they themselves are Muggles. For this reason the real distinction between Muggles and Wizards doesn’t uncut the earlier anti-racial themes because readers will not identify this as any sort of real message that is applicable to their real lives, but merely as a genre trope, a convenience serving the nature of the story.
The divorce between fantasy and reality is much greater in this instance. The racist belief that some races are superior to others in intelligence, physical prowess, and ability is too large of a metaphorical leap from the fantasy logic that some people can perform magic and others cannot for most people to read anything into this idea.
Even with all that said, Rowling paints the interrelations between these two dichotomous societies more complexly than just one having power over the other. Although most of the book shows the Wizarding World threatening to conquer the Muggle world, there are instances in the book when Muggles kill, torture, and harm wizards. The most obvious case being Dumbledore’s sister who is tortured by Muggles when they see her performing magic, but even Tom Riddle, the boy who would grow up to be Voldemort, lived also experienced a life being tortured by Muggles for being different in the orphanage. Harry Potter himself is verbally and psychologically abused by his adopted Muggle aunt and uncle. The Muggle world is just as much a threat to the Wizarding World as certain elements in the Wizarding World are a threat to the Muggle world. This explains why the Wizarding World needs to stay a secret. When Ministry officials tweak Muggle memories it is not out of some elitist joy of manipulating Muggles as rulers, but a general measure of preemptive self-defense.