Schedule 80 PVC is only rated to 140 degrees. And at that temp, it has a pressure derating of 0.22. So it almost certainly wouldn’t be strong enough for the pressure at the water heater.
I suppose that Schedule 80 CPVC could work. It is rated up to 200 degrees. And has a higher pressure rating, so it probably could work.
I’ve never seen anyone actually DO that. So although in theory it could work, I’d wait for Randy or Larry to weigh in with a ruling.