The introduction of heteroatoms into hollow carbon spheres is imperative for enhancing catalytic activity. Consequently, we investigated the utilization of nitrogen–oxygen(N/O) co-doped hollow carbon (C)/silica (SiO2) nanospheres (NxC@mSiO2), which have a large internal volume and a nano-constrained environment that limits metal aggregation and loss, making them a potential candidate. In this study, we demonstrate the synthesis of nitrogen–oxygen (N/O) co-doped hollow carbon spheres using resorcinol and formaldehyde as carbon precursors, covered with silica, and encapsulated with palladium nanoparticles (NPs) in situ. The N/O co-doping process introduced defects on the surface of the internal C structure, which acted as active sites and facilitated substrate adsorption. Subsequent treatment with hydrogen peroxide (H2O2) introduced numerous carboxyl groups onto the C structure, increasing the catalytic environment as acid auxiliaries. The carboxyl group is present in the carbon structure, as determined calculations based on by density functional theory, reduces the adsorption energy of acetylene, thereby promoting its adsorption and enrichment. Furthermore, H2O2-treatment enhanced the oxygen defects in the carbon structure, improving the dispersion of Pd NPs and defect structure. The Pd/NxC@mSiO2-H2O2 catalysts demonstrated outstanding performance in the acetylene dialkoxycarbonylation reaction, showcasing high selectivity towards 1,4-dicarboxylate (>93 %) and remarkable acetylene conversion (>92 %). Notably, the catalyst exhibited exceptional selectivity and durability throughout the reaction.