Religion is community. Community is community. Really, religion is not different from any other communal organization. Religions have become a little more fractured as society become more mobile, and as people attempt to distinguish religion from state. Of course, the reason for that was that religion was divisive, and if you took an end run around religion, you could unite a people. Still, what replaced religion was hardly different from it in anything but name.
So, if you think of countries as being very similar organizations to what religions used to be when everyone in a town was the member of the same religion, well, we see that countries are both divisive and collaborative. Just as what we now think of as religions are. All I can say is that religion, in some cases, has brought us more together, and in other cases, has driven us apart. However, I think this is more because that’s the way people are, than anything having to do with the religion.
People organize in groups for safety and economy. We develop rituals that support our sticking together. We engage other groups like us, we hope, to our mutual benefit. Sometimes we fight when we want the same resources and we can’t figure out a way to divide them peacefully. This is no different in nation-states now, compared to religion-states two thousand years ago (or any time in between).
So the answer to your question is…. yes!