Back in Elite 1, Firearms were illegal to trade at all ports. It was nevertheless legal to fit military-grade lasers, missiles, and energy bombs to your ship, fly that ship in any system, and use the weapons subject to not attacking a proscribed target.
And likewise in Elite Dangerous, most Federal and Alliance systems (and many independents) restrict the trade in lethal weapons but are quite happy for you to fly around with 16t plasma accelerators, cannons, lasers, and everything else. They'll even sell them to you!
The Elite series has never been a place for someone who wants consistent weapon-ownership/use laws to exist. We've been joking about smuggling weapons into stations by bolting the crates onto the outside of the ship since before Elite Dangerous was announced.
I will note that trade in weapons and other prohibited goods is a Fine rather than a Bounty offence - it's not a serious crime like Loitering where you can be shot on sight for it - so presumably it's some paperwork violation rather than anything people actually want to prevent outright. Odyssey is actually slightly better for this than Horizons in that carrying certain illegal items on foot does generate a death-level offence when scanned, rather than a "you know those e-breaches are illegal, right? 1000 credit fine for you" reaction.