We numerically investigate the formation processes of globular clusters (GCs) in gas-rich dwarf galaxies at high redshifts. Our particular focus is on how the first and second generations of stars can be formed from high-density gas clouds in dwarf galaxies. We find that massive stellar clumps first form from massive gas clumps that are developed from local gravitational instability in gas-rich dwarfs. These stellar clumps with masses larger than ~ 2 × 106 M⊙ can finally become the first generation of stars in GCs. After supernova explosion expels the remaining gas in the clumps, stars can form from eject of AGB stars that is accreted onto the central regions of the clumps (i.e., first generation of stars). The compact clusters of these stars have much higher densities and a significant amount of internal rotation (~ 5 km s−1) in comparison with the first generation and thus correspond to the second generation.