Do my washing machine and dryer need to be close to the water heater?
There's no problem moving the washer and dryer in respect to your question. The column of cold in the line would be well cleared for just about any reasonable distance by the time the load is ready to wash. But it is a concern if the run is very long. For the most part you don't need hot water anyway, unless you wear a lot of whites or work as a mechanic or get greasy clothes some other way. The bigger issue is the plumbing drains. Supplying hot and cold is probably easyish. If a suitable drain and vent are not available then you have a problem.