If it is a modern unvented boiler (has a pressure gauge), it has a pressure release valve which, in the event of increased pressure, squirts hot water through a pipe behind the boiler, which goes through the wall and is bent back so the hot water squirts against the wall rather than going over passers-by. This relieves excess pressure, and the boiler will then go out and not relight.
It also has an overheat thermostat which turns it off if the boiler gets too hot.
it is very unlikely to explode or to boil.
it also has a pressure seal to prevent gases escaping into the room, and the flue is not allowed to be close enough to any opening in the wall to allow fumes to blow into the house.
When it is serviced, once a year or so, or in a rented home, for the landlord's certificate, these points will be checked. The exhaust gases will also be tested to verify that it is burning cleanly and not producing appreciable CO.
CO2 is not poisonous.
You can get a CO monitor, rather like a smoke alarm, if you have reason to think you need one.
If it is a very old boiler, it might have a steel flue that could be rusty and leaking, or seals that are worn out, so old boilers are sometimes condemned as unsafe after inspection. If it is very old but in good condition, and regularly maintained, it should also be safe.
Vented boilers and stoves (no pressure gauge) can very rarely boil over into the small loft tank, you will hear them bubbling and banging very noisily if that happens. The loft tank has an overflow pipe to the outside. As such boilers are often old (but are still made, to modern standards) you ought to look out for such unexpected events and seek professional advice. Some noises are not so worrying.
Some people use the word "boiler" wrongly, to mean a hot-water cylinder, which is quite different.