Most stars in galaxies are known to form in star clusters. Although star clusters of various masses have been observed to date, young massive clusters (YMC) are very important objects in terms of their impact on the surrounding interstellar medium in the form of supernova explosions, stellar winds, and ultraviolet radiation. However, the formation mechanism of YMC is still a mystery. YMC are characterized by high stellar densities, and their formation requires the concentration of massive molecular gas, the raw material for stars, in compact regions. How such a region is created has been completely unknown, but recent observations have suggested that fast collisions of HI gas may form the YMC. In this study, we examine this scenario using MHD simulations including the effects of gas self-gravity, heating and cooling by radiation, the chemical evolution from HI gas to molecular gas, and the photoionization feedback to investigate the origin of the YMC. Our simulation results showed that a massive and compact gas clump, which can be a precursor of YMC, can be formed by the global gravitational collapse of molecular clouds formed in the shock wave compression layer produced by the collision. We found that the formed sufficiently compact massive gas clumps have a large escape velocity compared to the sound speed of the HII region, which means that gravity prevents gas evaporation and thus they form stars with a high star formation efficiency and evolve into a YMC. We also examined the initial condition dependence of YMC formation by fast HI gas collision. Our simulation results showed that the mass of the formed gas clump does not change significantly with the metallicity and that the mass of the formed gas clump becomes larger as the initial density of the colliding gas increases.