Referring to a gerund with a pronoun

Sure. Using the pronoun it there is perfectly grammatical.


Gerunds are words derived from verbs that are used as nouns; they can be used as subject of a sentence, and (as with every noun) you can replace them with pronouns.