Density Functional Theory (DFT) calculations, utilizing the full potential linearized augmented plane wave (FPLAPW) method, were performed to investigate the effect of boron (B) substitution on the InP system through GGA and mBJ-GGA formalisms, aiming to improve its band gap energy. Lattice equilibrium optimization determined that the stable structure of the alloys at equilibrium energy shows a decrease in lattice constants with increasing boron concentration (x). The calculated formation enthalpies, which are negative, indicate that these systems are experimentally synthesizable. The elastic analysis confirms that the doped alloys are elastically stable and exhibit ductile properties. The optical parameter analysis reveals that the optical energy loss functions are minimal or zero in the infrared, visible, and ultraviolet ranges, suggesting their suitability for optical applications across these energy ranges. Specifically, the band gaps were found to range from 0.878 eV for x = 0.25-1.920 eV for x = 0.75 using the mBJ-GGA formalism. Furthermore, the role of B-doping in the InP system for thermoelectric technology was systematically investigated, revealing that our alloys possess good thermoelectric properties with a figure of merit (ZT) reaching up to 0.7 for x = 0.75. These results demonstrate that accurate tuning of the energy band gap through doping is an effective technique for discovering novel materials suitable for both thermoelectric and optoelectronic applications.