As one of particular 2D transition metal dichalcogenide materials, the outstanding properties of MoS2 enable the promising formation of superior homo or heterojunction solar cells. However, in the process of introducing oxygen treatment to modify the interface defects of MoS2/Si solar cells, or modulate the Fermi level of MoS2 films, a thin layer of p-MoOx capping layer is generally produced next to MoS2. In order to essentially clarify the functional mechanism of MoOx layer, p-MoS2/n-Si heterojunction solar cells with or without MoOx interfacial layer are simulated using SCAPS software. The influences of band gap, electron affinity, thickness of MoS2 and front contact barrier height on the performances of p-MoS2/n-Si solar cells are theoretically studied. It is demonstrated that p-MoS2/n-Si solar cell can achieve a high efficiency of 21.9%. With the appearance of MoOx, the effect of location, electron affinity and thickness of MoOx on the photovoltaic performances p-MoS2/n-Si heterojunction solar cells are studied. The efficiencies of p-MoS2/p-MoOx/n-Si solar cells are significantly reduced to be lower than 11.4%, p-MoOx/p-MoS2/n-Si solar cells maintain superior efficiencies over 20% in a large range of electron affinities lower than 3.0 eV for p-MoOx. Consequently, in modulating the Fermi level of MoS2 films through MoOx doping, p-MoOx capping layer is suggested to be located between MoS2 and front electrode rather than at p-MoS2/n-Si interface, to maintain the excellent performances of p-MoS2/n-Si solar cells.