Strong coupling between molecular vibrations and microcavity modes has been demonstrated to modify physical and chemical properties of the molecular material. Here, we study the less explored coupling between lattice vibrations (phonons) and microcavity modes. Embedding thin layers of hexagonal boron nitride (hBN) into classical microcavities, we demonstrate the evolution from weak to ultrastrong phonon-photon coupling when the hBN thickness is increased from a few nanometers to a fully filled cavity. Remarkably, strong coupling is achieved for hBN layers as thin as 10 nm. Further, the ultrastrong coupling in fully filled cavities yields a polariton dispersion matching that of phonon polaritons in bulk hBN, highlighting that the maximum light-matter coupling in microcavities is limited to the coupling strength between photons and the bulk material. Tunable cavity phonon polaritons could become a versatile platform for studying how the coupling strength between photons and phonons may modify the properties of polar crystals.