There are many variations in this, not just in the types but in differing results and also depending on age and quality.
For example, NiMh cells shouldn't be discharged below 1 volt per cell minimum, or they might fail to accept a recharge and then be useless. That can happen with discharge down to about 0.9 volts, but at another time a cell of the same make and type can be recharged from only 0.4 volts.
I've no knowledge of what Li-ion cells do in this circumstance, since they haven't been around that long and are cosseted within protection circuitry that cuts off supply well before the damage point. Since they don't have a storage discharge loss and retain whatever they have, there's no accidental occurrence either.
The general rule with all types is to recharge at least every three months, and the more they go beyond that without a charge, the less likely that they will still be usable.
.