We investigated the crystal structure, growth kinetics and electrical properties of BeMgZnO/ZnO heterostructures grown by Molecular Beam Epitaxy (MBE). Transmission Electron Microscopy (TEM) studies revealed that incorporation of Mg into the BeZnO solid solution eliminates the high angle grain boundaries that are the major structural defects in ternary BeZnO. The significant improvement of x-ray diffraction intensity from quaternary BeMgZnO alloy compared to ternary BeZnO was attributed to the reduction of lattice strain, which is present in the latter due to the large difference of covalent radii between Be and Zn (1.22 Å for Zn, 0.96 Å for Be). Incorporation of Mg, which has a larger covalent radius of 1.41Å, reduced the strain in BeMgZnO thin films and also enhanced Be incorporation on lattice sites in the wurtzite lattice. The Zn/(Be + Mg) ratio necessary to obtain single-crystal O-polar BeMgZnO on (0001) GaN/sapphire templates was found to increase with increasing substrate temperature:3.9, 6.2, and 8.3 at substrate temperatures of 450°C, 475°C, and 500°C, respectively. Based on analysis of photoluminescence spectra from Be0.03MgyZn0.97-yO and evolution of reflection high-energy electron diffraction patterns observed in situ during the MBE growth, it has been deduced that more negative formation enthalpy of MgO compared to ZnO and the increased surface mobility of Mg adatoms at elevated substrate temperatures give rise to the nucleation of a MgO-rich wurtzite phase at relatively low Zn/(Be + Mg) ratios. We have demonstrated both theoretically and experimentally that the incorporation of Be into the barrier in Zn-polar BeMgZnO/ZnO and O-polar ZnO/BeMgZnO polarization doped heterostructures allows the alignment of piezoelectric polarization vector with that of spontaneous polarization due to the change of strain sign, thus increasing the amount of net polarization. This made it possible to achieve Zn-polar BeMgZnO/ZnO heterostructures grown on GaN/sapphire templates with two-dimensional electron gas densities substantially exceeding those in Zn-polar MgZnO/ZnO and O-polar ZnO/MgZnO heterostructures with similar Mg content.