I think having an outgroup is avoidable, but it requires ongoing vigilance, and an awareness that it is easy to slip into building your identity partly by deciding who to hate.
If we're careful I do think it's possible to maintain an attitude that we're basically all in this together, and we may have significant disagreements on all kinds of things, but at the end of the day we're still all humans and worthy of kindness and respect.