The first level of flood protection is....there isn't any. Washers and dishwashers traditionally had fill hoses direct from the supply tap. If the hose broke or the tail cracked water would run into the room full on. If the machine failed and overfilled or leaked the water would just run onto the floor.
Basic models still operate in this manner. In a laundry where there is a flood trap in the floor the risk of damage from water is minimal.Failure of washing machines where flooding occurs is minimal too. Dishwashers, being in the kitchen where there is no flood trap, have a more urgent need to be protected from flooding. Manufacturers of dishwashers over the years have addressed this issue in different ways.
One make has what they call an Aqua Stop system. Other makers have similar names for like devices.This flood protection system has a box fitting at the tap end of the fill hose and an outer tube or flexible conduit. The solenoid valve is in this box at the tap end of the hose, not inside of the machine. This means the wires to supply power to open the inlet valve solenoid must pass up the inlet tube. Inside of the inlet tube there is the wires to the valve and the water hose to take water into the machine. Machines fitted with this type of flood protection have a base pan where if water leaks out of the water hose inside of the outer tube it will pass down into the machine via the outer tube or conduit and run into the base pan where a float switch will trigger the flood switch to turn off the water supply and to turn on the drain pump of the appliance.In every instance, excep twhere the inlet valve were to jam in the open position, this would save a flood.