Is there some way to recover the heat which is lost through the exhaust system from a 'on demand water heater' ?
It is generally not worth the time and money to try to capture the lost heat through the exhaust system of the vast majority of tankless/on-demand water heaters. The heaters are now so efficient that they can vent the exhaust through plastic (PVC) pipe.
Since these heaters also only operate when there is a call for hot water, they do not run very often. Compare this to a traditional water heater that needs to keep many gallons of water in the tank at a certain temperature all the time.
Because a tankless system only runs on demand, and is extremely efficient when it runs, there is very little heat loss from this type of system. It would not be economical to modify the system to glean the tiny bit of lost energy. It would most likely take decades just to break even from this sort of modification.
Modifications to the flue are likely to be unwise and may be counterproductive or cause your heater to be dangerous or fail any safety checks.
There are fairly strict back pressure requirements for proper function. Even some models from 20 years ago recaptured some of the waste heat into the incoming air (concentric balanced flue).