Temperature is an average value of energy for all the atoms and molecules in a given system. Temperature is independent of how much matter there is in the system. It is simply an average of the energy in the system.
Heat can travel from one place to another in three ways: Conduction, Convection and Radiation. Both conduction and convection require matter to transfer heat.
If there is a temperature difference between two systems heat will always find a way to transfer from the higher to lower system .