I was not able to find any sections in NEC that prohibit switches from being installed in closets, so until somebody can point to a specific section I'd say it's not a problem. There may be adaptations to the code in your local area, so you'll have to check with the local Electrical Inspector to be absolutely sure.
The NEC does, however, have a section on luminaires in clothes closets.
NEC 2011
410.16 Luminaires in Clothes Closets.
(A) Luminaire Types Permitted. Listed luminaires of the following types shall be permitted to be installed in a closet:
(1) A surface-mounted or recessed incandescent luminaire with a
completely enclosed lamp
(2) A surface-mounted or recessed fluorescent luminaire
(3) Surface-mounted fluorescent or LED luminaires identified as
suitable for installation within the storage area
(B) Luminaire Types Not Permitted. Incandescent luminaires with
open or partially enclosed lamps and pendant luminaires or lampholders
shall not be permitted.
(C) Location. The minimum clearance between luminaires installed in clothes closets and the nearest point of a storage space shall be
as follows:
(1) 300 mm (12 in.) for surface-mounted incandescent or LED luminaires
with a completely enclosed light source installed on the wall above
the door or on the ceiling
(2) 150 mm (6 in.) for surface-mounted fluorescent luminaires installed
on the wall above the door or on the ceiling
(3) 150 mm (6 in.) for recessed incandescent or LED luminaires with a
completely enclosed light source installed in the wall or the ceiling
(4) 150 mm (6 in.) for recessed fluorescent luminaires installed in the
wall or the ceiling
(5) Surface-mounted fluorescent or LED luminaires shall be permitted to
be installed within the storage space where identified for this use.
Best Answer
Yes you can place the washer next to the electrical panel. As long as the door on the panel can open 90 degrees and there is a total width of 30" the panel it is legal. The working space 30" for the panel can be from 1 edge extending 30 inches beyond the other side (or actual width if the panel is wider).