A couple of points. There has been and aways will be friendly fire, wish it wasn't so. You used the word
“primarily”, Most wars are ideological in nature. Jews fought in all armies of WWII, blacks fought on both sides of the civil war and there are probably other examples.
The truly amazing thing is that we are having this discussion......................
Well, for folks like me, this isn't just an intellectual exercise. It's a life and death concern. There won't be uniforms in the next war.