We report inelastic x-ray scattering measurements of the in-plane polarized transverse acoustic phonon mode propagating along q∥ in various hole-doped compounds belonging to the 122 family of iron-based superconductors. The slope of the dispersion of this phonon mode is proportional to the square root of the shear modulus C66 in the q→0 limit and, hence, sensitive to the tetragonal to orthorhombic structural phase transition occurring in these compounds. In contrast to a recent report for Ba(Fe0.94Co0.06)2As2 [Weber et al., Phys. Rev. B 98, 014516 (2018)], we find qualitative agreement between values of C66 deduced from our experiments and those derived from measurements of the Young modulus in Ba1−x(K,Na)xFe2As2 at optimal doping. These results provide an upper limit of about 50 Å for the nematic correlation length for the investigated optimally hole-doped compounds. Furthermore, we also studied compounds at lower doping levels exhibiting the orthorhombic magnetic phase, where C66 is not accessible by volume probes, as well as the C4 tetragonal magnetic phase.