We have examined the thermal stability of wurtzite-phase MgxZn1-xO alloy films and ZnO/MgxZn1-xO bilayer films with x exceeding the reported solubility limit of 0.04. When a Mg0.23Zn0.78O film was annealed, the segregation of MgO started at 850 degrees C and the band gap was reduced to the value of that for an x = 0.15 film after annealing at 1000 degrees C. Mg0.15Zn0.85O films showed no change of the band gap even after annealing at 1000 degrees C. Therefore, we conclude that the thermodynamic solubility limit of MgO in MgxZn1-xO epitaxial film is about x = 0.15. The thermal diffusion of Mg across the MgxZn1-xO/ZnO interface was observed only after annealing above 700 degrees C. Unlike other II-VI semiconductors, ZnO-based alloy films and heterointerfaces are stable enough for the fabrication of high-crystallinity heterostructures.