A lot of that will depend on setting. In Eberon for example, hobgoblins are less likely to fit in with gnolls because they are a lawful militarily driven society, while gnolls are more chaotically nomadic. Though, necessity can drive the strangest of bedfellows. Enemy of my enemy is my friend as the saying goes. Alignment isnt a trust system, although it should inform one on the distance they keep and trust amongst their allies. Even in 3E, it is mentioned a paladin may have to align temporarily with an evil character if the situation demands it.