I like to think of humans as a pack species, like dogs. We function best, and are at our strongest, when in a group. In the past, our survival was often based around quick judgments about another pack's 'different-ness' from our own. Packs can vary in size and we can be members of multiple packs. I have a family pack, then an extended family pack, then a city, state, and country pack. All of which, if attacked, I will defend.
So, in that regard, things like racism will be very hard to get rid of. It's not impossible, it would just require us to survive, as a species, long enough to evolve away from those roots of suspicion. The cultures of the world would instantly unite if aliens attacked, but that wouldn't really solve the problem because then we'd just be racist against aliens.