That's why not everything in the holosuites/holodeck is holographic. If you eat or take drugs there, the computer would replicate whatever was needed.I think it'd be dangerous to create virtual molecules that would get inside your body and disappear as soon as you leave the holodeck, causing sudden local chemical imbalance that could be fatal in some cases. Nog spent a few weeks in the holosuite, had the food he ate then be virtual. countless of his cells, including brain cells would have died of inanition the moment he had left the holosuite, causing death or serious brain damage.