Should washing machines be placed on tile or other water-proof flooring?
It is common to set washing machines in a washing machine pan



These can handle minor leaks. Some versions include connections for floor drains that handle larger leaks.

Many apartment buildings that allow above basement washers require that a built in pan be an integral part of the floor and sometimes specify a deeper pan than the 2" versions.