In this paper, we study the impact of using III-nitride semiconductors (GaN, AlN) as substrates for ultrathin (11 nm) superconducting films of NbTiN deposited by reactive magnetron sputtering. The resulting NbTiN layers are (111)-oriented, fully relaxed, and they keep an epitaxial relation with the substrate. The higher critical superconducting temperature (Tc = 11.8 K) was obtained on AlN-on-sapphire, which was the substrate with smaller lattice mismatch with NbTiN. We attribute this improvement to a reduction of the NbTiN roughness, which appears associated to the relaxation of the lattice misfit with the substrate. On AlN-on-sapphire, superconducting nanowire single photon detectors (SNSPDs) were fabricated and tested, obtaining external quantum efficiencies that are in excellent agreement with theoretical calculations.