Rio de Janeiro is a city—the capital of the State of Rio de Janeiro in Brazil. It is not a country, so it has no national capital.
Confusion often arises because Rio was Brazil's national capital from 1763–1960, before Brasília was built. Today:
So: Rio is the capital of Rio (state), not of Brazil.