Does the hospital bed mattress prevent bedsores?

Depends. . There are a wide range of hospital mattresses. The basic ones do little to prevent. Then there are the air mattresses where the pt is sleeping on a cushion of air. This works much better. Really the best help is frequent changing of position to prevent prolonged pressure on one spot for more than 1. - -2 hours .
No. Pressure relief . Mattresses rarely prevent pressure sores with the exception of a few very expensive models that may have per issues such as hygiene. Only pressure relief prevents pressure sores.
Bedsores mattress. Most hospitals do not use standard mattresses. They use a higher grade of mattress that helps the staff prevent pressure sores from developing. Except for a few specialized beds, offloading pressure, frequent turning and common sense still are keys in prevention.