I have never seen a dog do this before; very strange behavior! Yet, for people, not so strange. People do all sorts of unexpected things, sometimes even to their friends. In the book of John, Jesus refers to something he knows will happen because it was predicted in the 41st Psalm.

Joh 13:10-18
(10) Jesus said to him, "Someone who has bathed only needs to have his feet washed, but is completely clean. You are clean, but not all of you."
(11) For he knew him who would betray him, therefore he said, "You are not all clean."
(12) So when he had washed their feet, put his outer garment back on, and sat down again, he said to them, "Do you know what I have done to you?
(13) You call me, 'Teacher' and 'Lord.' You say so correctly, for so I am.
(14) If I then, the Lord and the Teacher, have washed your feet, you also ought to wash one another's feet.
(15) For I have given you an example, that you also should do as I have done to you.
(16) Most certainly I tell you, a servant is not greater than his lord, neither one who is sent greater than he who sent him.
(17) If you know these things, blessed are you if you do them.
(18) I don't speak concerning all of you. I know whom I have chosen. But that the Scripture may be fulfilled, 'He who eats bread with me has lifted up his heel against me.'

Psa 41:9
(9) Yes, my own familiar friend, in whom I trusted, who ate bread with me, has lifted up his heel against me.

Jesus amazes me! How could he daily associate with Judas knowing full well that he was to be a traitor? Yet, he did and the weight of that knowledge must have been enormous. I am glad Jesus did what he had to do because of the blessing we all have received because of it. The thing is... if we stop following God's will for our life, aren't we acting like the "friend" in the picture? So, be clean from sin, obey God and stay out of trouble. Besides, both sin and mud are hard to clean up; its just easier to avoid the whole mess in the first place.