My water heater and dryer are connected to the same circuit breaker. Consequently, when the washer-dryer combo is in use the water heater (tank type) is working too and consuming electricity. Can I use a 240v extension cord with an on/off switch to connect my water heater? If it is possible, could someone provide me with a wiring diagram to connect this switch? Recommendations will be appreciated..
No, because you are talking about a 30A load, and that is way, way, way too much current for common switches. By the time you pay for the exotic switches you would need, you would just be better off wiring a subpanel.
It might be possible to wire that legally, but I rather doubt that's what happened. It sounds like an ugly hack job that's just waiting to electrocute someone. I wouldn't touch any of it with a 10-foot pole, especially if you are a tenant in somebody else's house.
You simply need to train your laundry people that they cannot run the dryer 30 minutes after anyone uses hot water. That shouldn't be in the way of washing clothes; hot water is only used at the beginning of the cycle, and the water heater should have caught up by the time the cycle ends and it's time to go in the dryer.
Stacking loads (drying one while the next one is in the wash) is not allowed unless they select "Cold" water.