Does it actually need to be legalised to be taxed? If there was a policy that tax collectors should not report drug offences when dealers pay up, and the penalties for not reporting drugs income were vastly disproportionate (i.e. prison sentences that make the punishments for dealing/possession seem lenient), it might be possible.