Heroin is an illegal drug, the government has deemed it illegal, it is almost universally illegal. It is not legal, owning it/ taking it is against the law. It is by it's very nature illegal. One of the innate characteristics of heroin is that it is illegal. Possession/ Acquisition and taking of heroin is illegal. It's illegal.
Taking heroin = criminal
Taking too much of your prescription medication/ someone else's medication = stupid. (in the UK not illegal, I don't know about elsewhere) Even if it is illegal where you are the nature of those drugs are prescription, not illegally obtained.