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:
さて、さるをお供にしたももたろうが、元気良く鬼が島に歩いて行くと、その途中で、今度は犬が現れました。
「……!」
「……!」
しかも、戦っています。
しかと、戦っています。
いぬ役の校長先生が、役をほっぽり出して、しかと戦っています。校長先生、出番ですよー!
[中略]
「な、なんでしかと戦っているのー!?」
このおじさんが校長先生だと知らないももたろうは、あわてるばかり。
たしかに、街中でいぬとしかが戦っていたら、誰だってびっくりします。
Translation:
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