In my games civilized places don't like heavily armed people walking around - but my players understand it. Pistols are usually ok, especially if concealed (not in plain view). But if you try to walk into Bespin carrying heavy rifles and dressed up in heavy or laminate armour - it means that you're looking for trouble. And local security - be it police forces, gangs etc. will at least take SOME interest in you.
Maybe not arrest you on the spot, but check your intentions - for example a licensed bounty hunter would be allowed in - usually. The PCs can always carry their heavy weapons in a bag or a case - unless the place's security is really tight, no-one will scan them.
On the planet my last game frequented, open carry was legal for pistols and one-handed melee weapons but concealed carry was a serious crime. Any carrying of grenades, Ranged (Heavy) or Gunnery weapons was illegal. Any use of a weapon against an unarmed individual was prosecuted more heavily by the local law enforcement, and even threats made by an armed individual against an unarmed individual were taken very seriously. IOW, if you wanted to pack heat, you could but then you were under much more serious scrutiny by the local law.