Cord and plug used for power connection to water heater. Water heaters need to be installed per manufactures requirements.
Per the Manufacturer: Install wiring in an approved conduit (if required by local codes). Use a UL listed or CSA approved strain relief to secure the electrical wiring to the water heater.
NEC 2014- 400.7(A) uses permitted for flexible cords.
(8) Appliances where the fastening means and mechanical connections are specifically designed to permit ready removal for maintenance and repair, and the appliance is intended or identified for flexible cord connection.
Most water heaters that will be allowed to be cord connected most likely would have the cord installed on them at the factory.
When using cords always use a cord and fittings identified for the application [400.3] and never use a flexible cord or cable in place of a permanent wiring method.