A bankrupt company could always offer new equity to its existing creditors as part of a Chapter 11 reorganization plan, but that's not exactly a sale. If you're describing a transfer to outside investors, then the sale of new equity could violate fraudulent transfer law and the bankruptcy trustee could try to claw it back to preserve the value of the estate. (See Bankruptcy Code § 548).
It's worth mentioning that creditors can throw an insolvent company involuntarily into bankruptcy by petitioning the court. Since creditors don't share in the upside of a company (like equity holders do), there's no reason for the creditors to let the company linger in bankruptcy so that it can gamble for its resurrection. It's in their best interest for the company to enter bankruptcy as soon as possible so they can preserve its value and maximize their payouts.
There might be edge cases (e.g. if there's a single creditor who happens to have a significant equity stake, it could play out differently) but I don't think it's the norm.
In this case Hertz bonds trade around 40 cents on the dollar [0], so there's a significant incentive for the creditors to let the company gamble for some upside.
[0] https://markets.businessinsider.com/bonds/hertz_corp-_thedl-...