I've held stock in a company that went bankrupt. Well, actually I saw it coming and sold for pennies on the dollar and got a few hundred for my roughly bought-for-$3k of stock. Those who held out all the way, if anyone was foolish enough to do so, lost it all. (Don't ask, it's too embarrassing - chalk it up a techie betting on a tech recovery based on knowledge of the product, not economics at the time.)
The only reason to buy stock in a company that's in bankruptcy would be for a quick flip since the penny stock prices can fluctuate rapidly and even a small amount of change is a large percentage at such prices. So if you feel lucky and want to gamble, the odds (if you watch a bit and have an idea) are probably no worse than Vegas, or not much worse anyway.