Depends on legislature. I think in the UK they broadly banned any "psychoactive" substance (ridiculous law, I know).
>excludes legitimate substances, such as food, alcohol, tobacco, nicotine, caffeine and medical products from the scope of the offence, as well as controlled drugs, which continue to be regulated by the Misuse of Drugs Act 1971
It's a really shoddy law. The idea that all psychoactive substances are banned except 'legitimate' ones such as alcohol, tobacco, and nicotine is really funny.
The property of legitimacy is with respect to laws, not common sense or popularity.