Hong Kong is administered since 1997 by the PRC. But the agreement between the UK and PRC when Hong Kong was turned over to China stipulated that Hong Kong would be a separate political entity with its own government until 2047. But since China controls HK, The March of the Volunteers is the official national anthem, not God Save the King as it was pre-1997.
Taiwan, on the other hand, is, in PRC-parlance, is a breakaway area that is still part of China. But since China has no political control over the Taiwan government, they still use the ROC anthem. However, for the Olympics, China can dictate what song is used for Taiwan gold medalists.