Answer:
The Prime Minister of the United Kingdom must simply be an elected Member of Parliament. Part of the qualifications required for election is that the candidate must be either a British citizen or a citizen of the Republic of Ireland or of a Commonwealth country.
So a British Prime Minister doesn't necessarily have to be British.
See links below for further information on the election of MPs and the appointment of the Prime Minister.