Yes, it is OK. It's perfectly correct. But it's not an everyday construction, and I don't blame you for thinking it sounds weird. Sometimes we have no choice but to create awkward-sounding sentences like this for tests, quizzes and so on.
Colloquially, a native speaker might go for the preposition-at-the-end option, and say something like, 'Where's London the capital of?' or 'What country's London the capital of?' which are equally awkward-sounding, but a bit shorter and more informal.
Sometimes there just isn't a neat way of saying things!