Unless you're talking about a closet already plumbed for a washing machine, the width or depth of the closet might be a minor point. Is there room for hot and cold supply, a gravity path for a drain to the gray tank? A source of proper electrical power?
I'd wait until you get back with the trailer and can have a professional give an estimate to install or if a washer can be placed in the closet. If you can do the work yourself, I'd still want to plan out all the utility needs before making a purchase of a washer.