Anaphoric “it” refers to the antecedent that is already clearly in the focus of attention. “It” is never stressed, because the focus presents itself, ready for pick up.
Anaphoric “that” references the contents of entire clauses or sentences or ideas to be inferred from what was said or was going on; “that” scopes wider and farther than “it,” and it’s often stressed.
The stressed “that” seems to reformulate or reestablish the focus of attention. If you can get away without stressing it (here “it” references ”that”), it’s likely that you could substitute “it” for “that.”
I need you to clean the windows. Can you do it?
“It” is unstressed.
“Can you do (unstressed) that?” would mean pretty much the same.
"Can you do (stressed) THAT? is colored with an implication:
“Hmm, I don’t think/I doubt you can” (because, for example, you cannot get anything done.)
Or, “Hmm, you refused to do the dished, walk the dog, ….so maybe, just maybe, you could clean the window?”