We have extensively explored the structural stability and high pressure phase transitions of NiAs-type compounds (AlP, AlAs, BeS, BeSe, BaO, TiS, and CrTe) by using ab initio lattice dynamics calculation. We have identified a pressure-induced unstable transverse acoustic phonon mode in AlP and AlAs and proposed a post-NiAs high pressure orthorhombic structure for these two compounds. No lattice dynamical instability was found in BeS, BeSe, and TiS upon compression, which can naturally explain the experimental observation of ultrastability of these compounds up to very high pressure. Systematic analysis suggested that high pressure phase transitions in NiAs-type compounds are intimately related to the $c/a$ ratio, where an ideal value of 1.633 is critical to determine the structural stability.