That is demonstrably false, legal sanction is what allows sex workers to be able to call the authorities on suspicious behavior towards them without risking their own arrest in the process.
I think it's a matter of enforcement than legislation. In Northern Ireland, prostitution is generally illegal but it's basically enforced only when the police suspect human trafficking. So they can raid a brothel, then arrest them for prostitution, get them somewhere safe, find out they were trafficked and drop the charges and get them help.