Is there a danger if the tyre or the inner tube suddenly burst?
The main danger can be an immediate loss of control.
Depending on when/where is happen, that loss of control can be minimal if going at slow speed to kill you if it happens going downhill at high speed.
Indoors it's not good for your hearing. I once misread the pressure ratings and exploded two tubes in a row.
At high speed it could cause you to crash, especially if it happens on the front wheel.
This is why it's always good to inspect the tyre for bulges if you feel a thump-thump-thump.
If a tyre or its tube bursts while cornering there's a strong chance of it losing grip. Losing grip on the front while cornering is quite likely to result in a crash, less so on the back, but if it's because the tyre is suddenly flat you may not be able to recover.
On the straight it's less likely to be serious. I've had a front blowout on the straight and I wasn't close to coming off. But I was going slowly to stop under the next light and investigate the dodgy noise (which turned to to have been the tube bulging through a slit in the sidewall and rubbing on the fork). A rear blowout on the straight is probably the most common, and the safest form of blowout. I've seen a few happen and they've never resulted in a crash.
Last time this happened around me I was wrenching on a bike and someone in the front of the shop blew out a tube. It was so loud the tool I was holding slipped off and made a nice scratch in the frame.
So yeah, it’s dangerous.