A normally working valve guitar amplifier is not dangerous in itself as long as it is not opened up. That’s fairly obvious otherwise they would not be sold!
The danger comes if the innards are exposed and you touch a live component.
In this respect they are far more dangerous than a transistor amplifier because they have high DC voltages (around 500v) which are far more lethal than 240V AC (present in all transistor amplifiers).
It’s usually ok to take the back off the amp to get at the valves for exchange because the manufacturers of valve guitar amplifiers consider the valves to be user serviceable parts. Obviously it’s important to switch the valve amplifier off first and disconnect from the wall.
To remove a valve give a firm, steady pull whilst rocking it around and around (in a small circle) until it comes free.
Be aware that some power valves have a retaining clip close to the base which must be sprung open with one hand whist removing the valve with the other.
The danger comes if you remove the chassis and expose the internal wiring and components.
Please note that lethal voltages may still be present inside the amplifier even if it is switched off and disconnected from the wall! This may seem counter-intuitive, but there are large capacitors inside the amplifier which store these high voltages, sometimes for several days before they eventually leak away.
Guitar amplifier technicians always discharge these high voltage caps before working on an amplifier.
So the advice is that unless you really know what you are doing, stay away from the innards of a valve guitar amplifier!