'To the head teacher's office'
One way to obtain the Welsh equivalent of this type of English phrase is to:
Put the English phrase the long way round:
to the head teacher's office › i swyddfa'r pennaeth
Get rid of the first 'the' and the 'of' in the phrase:
to the office of the head teacher
to office the head teacher › i swyddfa'r pennaeth
Remember that the preposition i causes a soft mutation. Also y and 'r will cause a soft mutation if they are followed by a feminine singular noun, e.g.
to the middle of the bridge > i ganol y bont