The description of the Dockyard building states the following:
QuoteYour Town Hall must have reached level 35, or the Governor’s Residence of your colony level 10.
Take note of the "OR" right there.
So if one has a town with a Town Hall of less that 35, so long as the Govenor's Residence has level 10, it should be fine to build. This is accurate for any city barring the capital, as the capital does not have a Govenor's Residence, as it instead has the Palace.
Given the Govenor's Residence has the same functionality as the Palace in the capital, and is for all intents and purposes essentially the same building; I am assuming this is an oversight, as it makes zero sense to disallow the contruction of a Dockyard in the capital simply because it does not have access to the specified building in name only.