As anyone familiar with the military knows, hats off indoors (unless under arms). I remember my drill sergeant telling me "The same goes for when you're in civies! If I see any o' you sons of bitches out 'n about with a hat on inside, I'm gonna smoke the shit outta you!! I don't give a shit where you are!!!
I should say that these aren't exact quotes, he did use the f word about 14 times in those 3 sentences.