Some heat pumps do this. E.g. Panasonic Aquarea EcoFleX. When cooling the house, the domestic hot water tank is used to dump heat into (up to a certain temperature).