Many people have thought about the drain heat exchanger. However drains need to be way oversized for various reasons and so you can't get good contact with the water: it is mostly air in the drain pipes.