Hard to compare with living with the general public as a military base is more "utopian". The military can ban anyone they want from coming on base and keep them out: drug addicts, gangs, homeless, felons, etc. Can't do that for the rest of society. And even then, if a terrorist or bad guy does get on base, there outcome will be similar. I think service members have a false sense of security on and off base because of this and also the team mentality where they think someone will protect them and back them up.
Not fair to compare the US to the other countries as we have many more freedoms, and with that comes risk. As Americans, most of us accept the added risk in order to have the freedoms. Also if there was a major war or invasion of those foreign countries, they would expect the US to get them out of trouble versus having their own citizens fight the war.