A growing number of recent observations have revealed that the Galactic globular cluster (GC) ω Cen is not the only GC that shows abundance spread in heavy elements (e.g. Fe). In order to understand the origin of the Galactic GCs with heavy element abundance spread (HEAS), we investigate the formation processes of massive GCs (MGCs) with masses larger than 106 M⊙ in gas-rich dwarf galaxies interacting and merging with the very young Galaxy. We find that massive and compact stellar clumps with masses larger than 106 M⊙, which can be regarded as progenitors of MGCs, can form from massive gas clumps that are developed through merging of gaseous regions initially at different radii and thus with different metallicities. Therefore, it is inevitable that MGCs formed in dwarfs have HEAS. The abundance spread in each individual MGC depends on the radial metallicity gradient of the host dwarf such that it can be larger for the steeper metallicity gradient. For example, MGCs formed in a dwarf with a central metallicity of [Fe/H] =−1.1 and the radial gradient of ∼−0.2 dex kpc−1 can have the abundance spread of Δ[Fe/H] ∼ 0.2. The simulated MGCs appear to be significantly flattened owing to their dissipative formation from gas discs of their host dwarfs. Based on these results, we discuss possibly diverse formation mechanisms for the Galactic GCs such as M22, M54, NGC 2419, ω Cen and Terzan 5.