In short yes, it's safe to sleep on a new mattress on the first night you have it. However, it might take up to a few weeks for it to settle – by that we mean some mattress need time to adjust to your body and soften, so don't be surprised if that first night's sleep is not as comfy as expected.
Do bear in mind that some mattresses, although to would be safe to sleep on, are recommended to wait 24 hours to sleep on so they have time to expand. This is common with mattresses that have come rolled in a box.