Would they be, though? Sure, in the medieval period on Earth, most peasants would probably be racist and afraid out outsiders...
Why restrict this to 'the medieval period'. Fear of outsiders is the default position of humanity. True cosmopolitianism is rare and well, associated almost entirely with city dwellers as the word suggests. And even then, the stock position is typically to divide into ghettos and wards with their own communities and culture. And even then, what you just typically end up with is city dwellers who fear and despise rural people.
but in D&D, the other races are common and can be found pretty much everywhere unless you have a setting that specifically sets out to make them rare--heck, a human commoner is more likely to run into a half-orc than a medieval Englishman would have been to run into someone from the Orient.
While I agree that rubbing elbows with your neighbors is one way to overcome racism, I think its niave to suggest that it inevitably does so. While people may be more afraid of what they don't know, close contact also leads to its own irritations and conflicts. Neighbors may hate each other for 'good reasons' and not just simply out of fear of the unknown. Differences in culture may lead to fundamental and irresolvable incompatibilities. If one group practices cannibalism and believes disputes should be settled by personal combat, it won't take 'racism' to get them into conflict with a group that believes cannibalism is barbaric, disgusting and probably immoral and that disputes ought to be settled in a court.
Besides which, whether or not races 'are common' is entirely campaign specific. In some worlds there might be whole nations made up of half-elves. On my world, half-elves are so rare that there probably aren't more than a six half-elves in the whole world at any given time. In one case, you'd not expect a half-breed to face much discrimination. In the other, it might be the overriding concern of their existance.
Hobgoblins believe that all other races are inferior; they are "insulting and dismissive" of non-hobgoblins.
It might interest you to know that my 'humans' are drawn from the real world culture of antiquity with all of its tribalism, racism, and xenophobia. However, I also assume that the degree of racism, tribalism, and xenophobia present in humans is actually far less than that of every other race. Every one of my major PC races normally believes that the other races are inferior. Most of them do not live in mixed communities, and even ones that are willing to live in mixed communities generally do not open their 'home lands' to outsiders. So in practice, its ownly human communities that are actually cosmopolitian and were significant mingling of the races occur. Humanity is virtually every races second favorite race (after its own), and often the chief problem they have with humanity is that they don't understand just how unredeemably nasty race X is.
Goblins believe they are the master race, destined to eventually wipe out every other race. Elves believe that they alone are fulfilling the task the gods set mortals to fulfill, and that the chiefest obstacle to fulfilling this task is the evil of the other races. Dwarves believe the other races are niave, foolish, and undisciplined, and that its because of the sheer stupidity of the other races that the world is going to hell. They are convinced that they alone can save the world from destruction, and if anything that gets in the way of dwarven interests for any reason at all is just a tool of evil. The fairies are immortal and uncreated, each believes that it is a god (however minor), and have absolutely no understanding of the other races (and generally this is mutual), and see the other races as slaves at best and objects at worst. The Orine are insane and even they admit this, and are generally best known for turning into beserking murderers at the drop of a hat. The Idreth have a collective racial memory, inscrutable motives, and live most of their life in monastic seclusion from the other races.
To say that these races don't typically get along is a vast understatement.
In fantasy worlds where monsters are around every corner and evil is a tangible force, I don't think the forces of Good (or at least Neutral) should be turning people away because of their race, they should be doing it for other reasons. A hobgoblin walks into town and passes the detect evil test?
I think you are incorrectly assuming that 'evil' and 'good' are neatly definable teams were everyone who is 'good' can presumably get along without disagreement.
but rather I dislike the knee-jerk "kill it!" reaction present in most worlds.
The biggest problem with this knee jerk reaction is that often as not it leads to counterproductive behavior. Presumably the reason for the "kill it!" reaction is that the characters having this reaction are trying to protect their life and property. So, for example, if it turns out that somebody is a vampire, werewolf, or witch, it's natural to assume that "kill it!" is a far safer reaction than "let's try to get along". However, if you look how this works out in humanoid interactions, it turns out "kill it!" is more likely to get you killed than "let's try to get along". The most obvious example of this is the way in which monsterous humanoids like goblins tend to try to ambush and kill every PC they come across, even though this almost inevitably leads to them being massacred. It's reasonable to assume that the reverse is true. If a group of human commoners first reaction to a random troop of hobgoblins is "kill it!", chances are they are going to end up dead when it inevitably turns out that that troop of hobgoblins is the 4th level hobgoblin mercenaries that are scheduled to eventually be mooks for the BBEG when the PC's are 8th level.
PC's of course behave differently, but then again they are mechanically different from most NPCs so they can usually afford to. One of the things I try to do early in my campaigns is establish that "kill it!" is not always an optimal course of action by introducing some EL 9+ encounter early on where the default assumption isn't that the PC's are going to behave like reflexive killers. Or failing that, at the very least demonstrating how to behave by showing NPC's interacting in some fashion other than 'kill it!'
Early in one campaign, before the party had significant loot, I had one group of PC's robbed by an overwhelming force of goblin bandits (mounted on worgs and clearly better equipped than the PC's). The PC's had pretty much no chance versus the bandits if the bandits were going to 'fight to the death' like typical monsters, but the bandits didn't want to fight with, much less kill the PC's. Thier position was: 'Get what loot we can from armed opponents without fighting unless we have to. Failing that, don't get killed because there is always some easier target than a well armed group of poor mercenaries around the corner' All the bandits wanted to do was extort some cash. Of course, I didn't tell the PC's that outright, but I let them work it out for themselves. If the PC's tried to fight, the bandits would try to take the PC's alive (because they are valuable as slaves) using lassos, nets and nonlethal damage, but would flee if the PC's put up good enough resistance. Afterall, the goblins didn't know that the PC's were 1st level. The PC's could use social skills to talk their way out of the problem, or at least negotiate the damages to their pocket books required to get out of the problem.
The purpose of encounters like that is to help the players unlearn what they may have learned about surviving in D&D. One of the surest ways to die in my game is assume that every problem can and should be overcome by trying to achieve a surprise and fighting to the death. That is inevitably going to generate TPKs in my game, because I think having a god show up at 1st level is kinda cool, and in sandbox mode the highest level encounter on the map might well be 17 levels or more above party level. I was pleased to see that my present party has already learned the important lesson, "Leave things that belong to a god alone - even if you really really don't like that god - unless you have a very very good reason." This is going to be important because an equally important lesson in a game informed by greek myth is, "I don't care how high level you are, don't be rude to a deity. It just doesn't pay."
However, most humanoid creatures are humans with makeup, essentially
I think this is the result of limited imagination, which has sadly often been encouraged by the source material. I cringe when I see published material were a thing as alien as 'dragon' or 'demon' is treated as if it had exactly the same basic emotions and motivations as humans, and were the author's assumption seems to be that sentience implies humanity. I don't think that it necessarily has to be so. I believe that things that aren't human ought to be alien or else they have no real purpose.