Strain and piezoelectric effects on the phonon frequencies in heterostructures