It's been used for a long time to describe any kind of illegal drug.
Some people think it only refers to heroin. This is incorrect as many rappers and people who live in drug infested areas call marijuana, crack and heroin dope and those who sell them as dope dealers.
"From a kid to a G, it's all about money
10-piece, 4-10, base pipe comes free
If people out there ain't hip to the fact
If you see somebody gettin' money 4 crack
People who do Marajuanna call Heroin Dope.
Word has also been used to describe how good somthing is.
OMG, I smoke the green but I don't do dope ( AKA Heroin )
Man that car is dope!