The structural and electronic properties of neutral and charged Mg and ZnMg clusters, for different sizes, have been investigated in order to know how the reactivity of pure magnesium clusters will be influenced by the substitution of a single atom of zinc, and how these clusters interact with the oxygen atom. The calculations have been performed in the framework of the density functional theory in the generalized gradient approximation for the exchange and correlation. The results show that doping with a single Zn impurity is enough to change the structure of the host magnesium cluster and modify the bonding pattern making the structures more stable. The calculated adiabatic electron affinity and vertical detachment energy of pure magnesium clusters show good agreement with the available experimental data and indicate that Zn doping enhances their stability during the reduction process. The adsorption of Zn atom significantly affects the stability of the magnesium clusters during the oxidation process. The calculated results of the adsorption energy of oxygen show that, in general, the reactivity of oxygen atom decreases when the cluster size increase, which impact their anticorrosive properties making them more suitable for generating protective coating layers.