Hi Rohrgatz,
There is more about some of the things you can check for if you are considering buying a used mattress in post #2 here and if you are considering buying a mattress from a liquidator or clearance store that sells used mattresses then there is more here and here and here that I would read and that may be helpful as well.
If a cat or a dog had an accident on the mattress and the mattress wasn’t protected (or if there were other types of bodily fluids or “accidents” on the mattress) it would still be in the cover regardless of the material that was inside the mattress and I think that many if not most people wouldn’t be comfortable sleeping on it knowing what they are sleeping on unless the mattress cover had been replaced and/or they were satisfied that the mattress had been sterilized.
This would depend on the specific design of the mattress and the type and quality of the materials and foam layers inside it. For higher quality/density materials it would probably be fine and for lower quality/density materials it probably wouldn’t.
Overall … IMO you are looking at the type of purchase that can be very risky and would very much be “buyer beware”.
Phoenix