Not in countries with bedbugs.
That said, I would totally buy a second hand mattress. People buy used clothes all the time, isn't that similar? Could contain anything (including bed bugs, the top ddg hits seem to suggest).
If you buy used clothes you would (hopefully) wash and dry them thoroughly not just for bedbugs but for other parasites like head lice, chiggers, crab lice or whatever. Good luck cramming a mattress into the wash though :-P
That’s an easily industrializable problem for mattresses. They’re standard size.
Seal them up in plastic when you’re done.
Getting them out of furniture or behind floorboards is harder.