Why do the dogs pet the characters in Nichijou?
I looked up that video by googling the title, and the answer appears right next: Grandpa appears and does the same hand gesture as the dogs are doing with their paws − touches "Takashi" on the shoulder. Grandpa then explains that humans console each other, and dogs do the same thing.