You might mean this: "London is the capital of the United Kingdom."
You need to say "the" because a nation (or anything else) has only one capital.
I think you say "United Kingdom" and not "Great Britain," because the word "capital" refers to government. The name of the country is "the United Kingdom." Great Britain is the geographic name of an island.
Now, you can say that the United Kingdom is made up of four countries: England, Scotland, Wales, and Northern Ireland. You can say that each of these countries has a capital. London is the capital of England, Edinburgh is the capital of Scotland, Cardiff is the capital of Wales, Belfast is the capital of Northern Ireland.
Possibly you are trying to express this idea. "Great Britain contains three countries, each with a capital city. London is a capital city in Great Britain, and so are Edinburgh and Cardiff." It is very difficult to find a short, natural way to express this idea. In any case, Great Britain is not a nation, so there is no "capital of Great Britain." You would use the preposition "in." There are three capital cities in Great Britain.