Answering the question directly, there are no occurrences where the headmaster visits Hakase in any media, but they have met once.
In Nichijou no Shousetsu light novel, there's a chapter called "Nichijou no Mukashibanashi" (Everyday's Folklore) telling the story of Momotaro with Nichijou's characters. Hakase acted as Momotaro, while the headmaster's role was the dog. Here's the relevant script:
And so, the monkey that befriended Momotaro and the vigorous demon are walking toward the island. On the way, this time they see a dog.
Moreover, he is fighting.
He is fighting with a deer.
The headmaster whose role is the dog abandoned his role and is fighting with the deer. Headmaster, it's your turn now~!
"Wh-, why are you fighting with the deer!?"
Momotaro, who doesn't know that this old man (ojisan) is the headmaster, is only confused.
Certainly, everyone will be surprised seeing a dog and deer fighting each other in the middle of a road.
P.S. The headmaster's name was only mentioned in the anime.
Source: Yahoo! Chiebukuro