Heat is transferred from the region of higher temperature to the region of lower temperature. This is a fundamental principle of heat transfer.
When two objects with different temperatures come in contact, heat will always flow from the hotter object to the cooler object until thermal equilibrium is reached.