Abstract Recent observational studies have revealed star-to-star abundance inhomogeneity among light elements (e.g. C, N, O, Na and Al) of stars on the main sequence in the Galactic globular clusters (GCs). One of the promising interpretations for this result is that the observed abundance inhomogeneity is due to the second generation of stars formed from ejecta of the first generation of evolved stars (e.g. asymptotic giant branch stars) within GCs. However, it remains unclear whether and how this primordial pollution can occur within GCs. We here propose a new scenario in which primordial pollution of GCs is highly likely to occur if GCs are located in the central regions of high-redshift dark matter subhaloes that can host low-mass dwarf galaxies. In this scenario, gas ejected from the first generation of stars of GCs can be effectively trapped in the deep gravitational potential of their host haloes, and consequently can be consumed for the formation of the second generation of stars without losing a significant amount of gas by ram pressure stripping of interstellar and intergalactic medium. During merging of these haloes with the proto-Galaxy, the haloes are completely destroyed owing to the strong tidal field of the Galaxy. The self-polluted GCs located initially in the central regions of the haloes can survive tidal destruction owing to their compactness and finally become the Galactic halo GCs. In this scenario, ejecta of field stars surrounding the central GCs can be also converted into stars within their host dwarfs and finally become the second generation of stars of GCs. We also discuss the origin of the difference in the degree of abundance inhomogeneity between different GCs, such as ω Centauri and NGC 6752, in terms of the difference in physical properties between host haloes from which GCs originate.