This work reports an atomic-scale carbon layer configuration tuning strategy induced by a boron dopant. Through regulating the doping level of boron, it was found that the boron dopant not only favors carbon layer growth by strengthening the metallic state of the Ni core, but also enhances the abundance of pyrrolic N species and graphitization degree of carbon by tailoring the carbon/nitrogen atom configuration, thereby contributing to more active pyrrolic N/carbon sites and accelerated interface reaction dynamics. Consequently, the developed Ni@B,N-C catalyst achieves remarkable electrochemical H2O2 production performances with a high selectivity of 95.5% and a yield of 795 mmol g-1 h-1. In comparison with previous reports in which the boron dopant mainly acts as an electronic structure regulator, this study reveals the tuning effect of boron dopants on the atomic-scale carbon layer configuration, opening up a new avenue for the development of advanced catalysts.