AMERICAN ANSWER
There are BIG differences between the services in this, and I mean the cultural gap is huge.
The American Navy descended almost directly from the British Navy and is hugely class-conscious. Officers and enlisted don’t mix. Officers, speak to chiefs and chiefs direct the men. There aren’t just two different messes, there are three — officers, senior enlisted and junior enlisted.
There is a reason for everything that persists. Life is very fragile on a ship—take a nuclear submarine: a wrong move kills everyone aboard. Familiarity breeds contempt. Better to let the Captain remain a godlike figure rather than Fred who likes knitting to relieve stress. A little psychological distance is a good thing.
The Army was heavily influenced by the proto-Germans (Prussians) and the French— a lot more egalitarian than the Navy, but still conscious of rank. We eat together in the field, there is only one mess hall, though we may be at separate tables. There was only one mess hall in Iraq — Generals and Privates ate in the same space.

The Air Force is directly descended from the army, and the least rank conscious part of the army, aviation. Their enlisted are smart, they are technicians, and they keep the planes in the air. The Air Force uniforms are more egalitarian, I do not think there is any problem with an air crew sitting and eating together in the air force.
So I think you need to calibrate your expectations to the service you are discussing.