When? You give the impression that these places are still UK colonies... I'll answer for Hong Kong.
1. Colonial Office in London would have been in charge of Hong Kong. In the 19th century a lot of leeway would probably have been given to British consulates in Shanghai, Guangzhou etc. and the British ambassador in Peking as well. The Governors of Hong Kong were generally also experienced China hands, and so could use their expertise to 'force' the Colonial Office to do what they wanted.
2. As mentioned earlier, being a Governor of Hong Kong in the 19th century would generally mean that you would be seen as an experienced China hand, and so the Colonial Office would likely defer to your obviously superior judgment.
Obviously you will still have to compete with the other British representatives in China. Important things like war are still the prerogative of the Colonial Office, though a skilful Governor could make 'facts on the ground' (e.g. the Arrow Affair that sparked off the Second Opium War, started off when Bowring [the Governor of Hong Kong at the time] fired on Guangzhou after negotiations had been concluded)
The power of the Hong Kong Governors diminished with increasing communications, but surged once more after 1945, the Hong Kong Colonial Government generally ignoring all directives from London unless it coincided with their interests, such as the 1952 PRC-UK agreement for no political reform for Hong Kong. In the 1960s the Hong Kong Government actively pushed for the reduction of British textiles tariffs that allowed Hong Kong fabric to destroy the British fabric industry; in the 1970s Hong Kong refused to use its massive sterling reserves to save the plummeting pound. And Hong Kong refused to follow later directives for London calling for better welfare/more democracy. No surprise that Whitehall dubbed the colony 'The Republic of Hong Kong' throughout the 70s and 80s.
But negotiation with China generally remained the prerogative of London, though Governors could make trips to Beijing (such as Youde in 1986). There was always pressure from London to have Hong Kong Governors not ruin relations between the PRC and the UK, demonstrated during the Governorships of Wilson and Patten in the 1990s.