In general: it's not our job to enforce the law.
That means, just because something might be illegal somewhere, we shouldn't delete it. Instead, if you think the OP might be affected by it, leave a comment saying
FYI: What you're asking for might violate law X in Y jurisdiction.
and that should sort the issue - they can take their own decisions.
However - if something comes up that's either very clearly illegal everywhere, or something comes up that we decide we don't want to allow, we can and should delete it.
As Shog9 explains, some communities decide to disallow questions on a particular topic, either because the issues surrounding the topic are complicated, or because they don't want to be seen to support the issue. That's fine, we can do that. For example, Arqade disallows questions about piracy, and Super User disallows questions on Hackintosh.
If something's actively harmful to the community, or we decide we don't want it, then it gets deleted. If it's just a case that it's sometimes illegal, a comment will do.