'this' and 'that ' are determiners ,that refer to someone or something that is either close ( this) or far ( that).
This is a nice dress.
That book there doesn't belong to me.
"It" as a pronoun could refer to refers to a nonhuman, animal, plant, or inanimate thing, or sometimes to a small baby .
'It is small' referring to a baby
"It is a big one, give it a bone" referring to a dog
"It is a huge tree."
Notice that you can use 'this' and 'that' in the above 3 sentences as in :
this is small , this is a big one , that is a huge tree...
You will choose which one to use according to the context ,whether you want to determine and point at something near or far or just substitute the inanimate noun with a pronoun (it).
"It " refers to an unspecified or implied antecedent or to a previous or understood clause, phrase, etc.
'It is impossible'
You probably know from the previous clause ,what 'it' refers to here.
'IT" is also used to represent human life or experience either in totality or in respect of the present situation .
"How is it going?"
Notice that you could also say 'this is impossible' or 'that is impossible' .
In the case of 'how is it going?" you can't say 'how is this going?" instead.
If you say 'it is raining' as well ,you can't say instead 'this or that is raining.
So when 'if' is used to represent an experience ,in that particular case you can not substitute it with 'this or that'.