Some of the literally are their own municipalities.
Two examples: The University of Notre Dame is in Notre Dame, Indiana, which happens to be surrounded by South Bend, Indiana. Same with Stanford... which is technically in Stanford, California.
Is there anywhere else that has the US model? I worked on a UK university campus for a few years and I don't think they had any security guards (certainly I never met any and I was in and out of buildings at all hours) let alone armed police!
I think UK universities mostly include limited security in their general pastoral support, rather than having dedicated security guards. So there's someone who can e.g. ask a stranger loitering on campus at night what they're doing, but anything serious will be handled by the police.
Two examples: The University of Notre Dame is in Notre Dame, Indiana, which happens to be surrounded by South Bend, Indiana. Same with Stanford... which is technically in Stanford, California.