This work aims to develop efficient cathode materials for magnesium based batteries, which are considered promising next-generation energy storage and conversion devices. One major challenge in magnesium based batteries is the strong Coulomb interaction between magnesium ions and cathode materials, which hinders ion storage and diffusion. To overcome this, we designed and synthesized oxygen vacancy-rich MoO2-x/N-doped carbon nanowires (MoO2-x-NC-NWS). The materials were prepared through a controlled synthesis process, ensuring the incorporation of N-doped carbon and oxygen vacancies, which play crucial roles in improving magnesium ion diffusion and storage. The prepared MoO2-x-NC-NWS demonstrated superior energy storage performance, achieving a capacity of 64 mAh/g in magnesium batteries and 263 mAh/g in magnesium-lithium hybrid batteries at a current density of 50 mA/g. Theoretical calculations further confirmed that oxygen vacancies enhance the diffusion capabilities of magnesium and lithium ions, thereby improving the overall energy storage performance. Therefore, the controllable synthesis of defects such as oxygen vacancies and the development of composite cathode materials are clearly effective strategies for enhancing the performance of magnesium-based battery cathodes. Meanwhile, this rational design of MoO2-based nanostructures provides valuable insights into the development of high-performance cathode materials for magnesium-based energy storage systems.