Single-atom or atomically dispersed metal materials have emerged as highly efficient catalysts, but their potential as excellent supports has rarely been reported. In this work, we prepared Mg-N-C materials derived from annealing of a Mg-based metal-organic framework (MOF). By introducing Pt, Mg-N-C not only serves as a platform for anchoring Pt nanoparticles but also facilitates the integration of Mg into the Pt face-centered cubic lattice, resulting in the formation of highly crystalline Pt3Mg nanoalloys via the metal-support interfacial interaction. Synchrotron radiation-based X-ray absorption spectroscopy (XAS) enables us to study the interfacial interaction and the surface electronic structure of this intricate system. The formation of Pt3Mg nanoalloys induces a downshift of the Pt d-band (gaining d-charge), as revealed by the decrease in the Pt L3-edge white-line (WL) area under the curve. This downshift can weaken the binding of oxygen reduction reaction (ORR) intermediates, hence improving the ORR performance.