Take a look at our stations and try imagine a pirate freighter docking with explosive cargo. Imagine the sheer danger of such an action. Pirates aren't known for their finesse generally (Most common pirates that is) and no doubt there are several accidents on these stations.
Yet they can't simply tell the freighter to go away, they need those supplies!
So they are left with having to endure explosions and dangerous goods transfers, not to forget the station being full up of fighters/freighters and many having to wait outside.
A solution you ask for, here is one.
Often pirate or unlawful stations would construct makeshift mooring points nearby to facilitate dangerous cargo transfers and to give outer moorings for ships if the station docking bays were full. Unfortunately there is clear evidence of said dangerous goods still causing damage and so these mooring points are regularly rebuilt out of the pieces of scrap they were blown into.