Absolutely! But it carries over even after your service is finished. Another brother that I work out with, we became friends while discussing port-of-calls in Asia only to find out we probably passed each other on the street many times and had mutual friends. He is black and we actually can discuss race issues and politics, disagree at times and are still best friends.
Yes, I am still friends with military people I served with 30 years later.