A shower that gets hot water coming out when you flush the toilet is caused by a drop in the cold water pressure going to the shower when the toilet is flushed.
When you flush the toilet you're lowering the cold water pressure and then mostly hot water runs through the shower head which makes the shower water hot which potentially burns someone.
Having a mixing valve can usually fix the problem of a shower getting too hot when a toilet is flushed as long as the mixing valve is set and adjusted correctly.