Is there a chance of contaminating the incoming water with the drain water?


Realistically, no. The design of in-line waste heat recovery devices, specifically creates two copper walls and an air gap between the two fluids. The design is government -plumbing code approved for heat transfer between "black" water and potable water.