The invention discloses a nano magnesium-aluminum anti-corrosion coating. The coating comprises a first component and a second component, wherein the second component is formed by mixing a component A with a component B; the first component comprises components as follows: epoxy resin, hydroxyl acrylic resin and ammonium dihydrogen phosphate; the component A comprises components as follows: nano magnesium oxide, nano aluminum oxide, nano titanium dioxide, nano zirconium dioxide, nano rare earth oxide and deionized water; the component B comprises components as follows: butanol, filler, barium sulfate, diethylenetriamine and dipropylene glycol butyl ether. The invention further discloses a preparation method of the nano magnesium-aluminum anti-corrosion coating. The coating is high in mechanical strength and excellent in wear resistance, hardness, compressive strength and impact resistance, meanwhile, the preparation technology is simple and easy to operate, the cost is lower, the production process is safe and environment-friendly, and no pollutant is produced.