If a "country" is defined by the existence of ISO region code, then among the 25 countries I have visited, I have visited 12 capitals:
Hong Kong - Victoria City
Macau - Macau
Singapore - Singapore
China - Beijing
Latvia - Riga
Estonia - Tallinn
Czechia - Prague
Finland - Helsinki
Egypt - Cairo
Thailand - Bangkok
Vietnam - Hanoi
Sweden - Stockholm
with transfers at the following capitals:
Russia - Moscow
South Korea - Seoul
Lithuania - Vilnius
Azerbaijan - Baku
Bulgaria - Sofia