It was a summer afternoon, and the dog was sitting in the middle of the lawn. After a while, it got up and moved to a spot under the tree, because *it* was hot.

Do "the dog" and "it" have the same meaning?
yes