The dog that comes joyfully bounding up to the condemned Hindu prisoner in the prison yard only sees the prisoner as just another person he can play with and lick in the face. The dog doesn’t see him as someone who has committed a crime or as someone who is about to die. The dog is playful and just excited to be around so many people. This brief encounter with the dog begins to affect Orwell as he starts to realize that the prisoner is a person just like he is. Later in the story, after the dog is brought under control by the guards, Orwell sees the prisoner step aside to avoid a puddle of water and observes that,
"This man was not dying, he was alive just as we were alive. All the organs of his body were working — bowels digesting food, skin renewing itself, nails growing, tissues forming — all toiling away in solemn foolery. . . His eyes saw the yellow gravel and the grey walls, and his brain still remembered, foresaw, reasoned — reasoned even about puddles. He and we were a party of men walking together, seeing, hearing, feeling, understanding the same world; and in two minutes, with a sudden snap, one of us would be gone — one mind less, one world less."
Like the dog who has no prejudices or biases towards the prisoner, Orwell suddenly learns and understands the meaning of what it is to hang a man and end a life. Remember, Orwell never tells us the prisoner’s crime, keeping the reader guessing as to what the puny, Hindu man could have done to be hanged. Until the dog does this act of acceptance, Orwell is resigned to hanging this prisoner. When the prisoner is dead, the dog hides in the corner of the yard and trembles because he realizes the fate of the man. Later, Orwell also reflects on the horrors of the hanging and how in an instant a living, breathing man was killed.
I guess I would say that there are two ways you can look at this.
First, you can look at the dog as comic relief. Comic relief is used in plays and such -- there's a bit of comedy during a tense time to let the audience relax a bit. You could say that this is what is going on.
The other thing you can say is that the dog sort of indicates how inhumane the hanging is. When the hanging is first starting, it works sort of like a machine. But then when the dog comes in, all the participants become human again, in a sense. They have to react to something in human ways instead of just carrying our their assignments like machines.
Since the dog makes them more human, it sort of emphasizes how inhumane the hanging itself is.