Elastic constant C11 and piezoelectric stress constant e1,11 of two-dimensional (2D) dielectric materials comprising h-BN, 2H MoS2 and other transition metal dichalcogenides (TMDCs) and -dioxides (TMDOs) are calculated using lattice dynamical theory. The results are compared with corresponding quantities obtained by ab-initio calculations. We identify the difference between clamped-ion and relaxed-ion contributions with the dependence on inner strains which are due to the relative displacements of the ions in the unit cell. Lattice dynamics allows to express the inner strains contributions in terms of microscopic quantities such as effective ionic charges and optoacoustical couplings, which allows us to clarify differences in the piezoelectric behavior between h-BN versus MoS2. Trends in the different microscopic quantities as functions of atomic composition are discussed.