Doping heteroatoms into metal phosphides to modify their electronic structure is an effective method, but the incomplete exposure of active sites is its inherent drawback. In this experiment, both Se doping and P vacancies are simultaneously introduced into CoP-Fe2P (named CoFe-P-Se) to enhance the internal reactivity. Benefiting from the unique hollow porous structure derived from the MOF-on-MOF template, as well as the enhanced intrinsic activity achieved by P defects and Se doping, CoFe-P-Se exhibits a high specific capacitance of 8.41 F cm-2 at a current density of 2 mA cm-2 when used as a supercapacitor electrode. When assembled into a hybrid supercapacitor with activated carbon, the energy density reaches 0.488 mWh cm-2 at a power density of 1.534 mW cm-2, and the capacity retention after 5000 charge-discharge cycles is as high as 90.65%. As an oxygen evolution reaction (OER) electrode, the CoFe-P-Se electrode shows a low overpotential of only 230 mV at a current density of 10 mA cm-2 and 278 mV at 100 mA cm-2. Additionally, it exhibits excellent stability for over 50 h at a current density of 100 mA cm-2. The designed element doping and vacancy engineering in this work will provide an insight for constructing high-performance electrodes.