Any Authority NPCs will cease scanning (or abort an active scan) the very Moment the Ship passes the entry of a Station.
Even at an Outpost, an NPC will cease action as soon as the Player docks on the Pad - the NPC will loiter around and begin triggering scans onto other NPC Ships arriving or departing.
The only Vessels capable of scanning a docked Ship are other Players.
In the distant Past, Player-scans were relayed to security and could indeed ruin a Smuggler's day.
However, I believe the "instant Security Relay" by a Player Cargo Scan are long over (?)
(it used to be a big thing by the usual crowd in the typical places, but AFAIK this isn't possible anymore - just like KWS'ing a Wanted NPC in the presence of Authority NPCs doesn't cause an instant Aggro by the Station/Security anymore as it did in the very distant past).
The Journal might yield the only clue, but Black Market trading - for all I know - does not negatively affect local Reputation at all.
I could only think of an old bug that used to haunt Open Play in busy instances - local Rep of a Station suddenly switching from {Anything} to Hostile, similar to Stations changing owning Factions and other related weird quirks.
Unsure though if that years old bug still occurs - but if so, it would represent the only way to become hostile while docked, since there's no other way - short of scraping another Ship >100m/sec and managing to settle onto the Pad a second before the hit Ship blows up. But even that could be fixed by a relog.