In GaN-based laser diode (LD) structures, Mg doping in p-type-doped layers has a significant influence on the device performance. As the doping concentration increases, the operation voltage decreases, whereas the output power decreases as a result of increased optical absorption, implying that optimization of the Mg doping concentration is required. In this study, we systematically investigated the effect of the Mg doping concentration in the AlGaN electron-blocking layer (EBL) and the AlGaN p-cladding layer on the output power, forward voltage, and wall-plug efficiency (WPE) of InGaN blue LD structures using numerical simulations. In the optimization of the EBL, an Al composition of 20% and an Mg doping concentration of 3 × 1019 cm−3 exhibited the best performance, with negligible electron leakage and a high WPE. The optimum Mg concentration of the p-AlGaN cladding layer was found to be ~1.5 × 1019 cm−3, where the maximum WPE of 38.6% was obtained for a blue LD with a threshold current density of 1 kA/cm2 and a slope efficiency of 2.1 W/A.