Here's why:
* Direct objects are the nouns or pronouns that receive the action of the verb.
* The verb in this sentence is "followed."
* The child is the one performing the action, but the dog is the one being followed.
Therefore, "dog" is the direct object.