Thermometers can be constructed from a large number of physical phenomena which are temperature sensitive:
Thermal expansion is the most common since it is used in the
mercury thermometers and the bimetallic strips in thermostats.
However these things are being gradually phased out. The disposable
thermometers used in hospitals employ a change in color with
temperature (chemo-luminescence.) Thermal expansion is a property of
all materials. As you heat them, they expand. It is an effect due to
the shape of the potential energy vs. distance between molecules.
There are examples of materials which contract when heated, water at
the freezing point contracts as you heat it to 4° C, at which
point is has maximum density. This is why lakes remain unfrozen at
the bottom and fish can survive the winter.