It is simple to understand if you try to write down feynman diagrams for proton proton giving a Higgs :
gluons give pairs of quark antiquark. The spectator protons will also give jets or even more gluons might be radiated because the energies are high.
The Higgs has high couplings(proportional to mass) with the top-antitop loop , and so this is dominant for two gamma decays .
Higgs to quark antiquark pairs is only limited by the mass of the Higgs. Searches are on at LHC to find the Higgs to b bbar channel.
For the general case, the gluon can generate all quark antiquark pairs that conserve energy and momentum for the interaction.