LONDON (AP) _ Prime Minister Margaret Thatcher's Conservatives are expected to retain Kensington, a district of both princes and paupers, in a by-election Thursday that will give her radical new economic plan its first electoral test.

The vote in the 3-square-mile west London district coincides with declining ratings for the opposition Labor Party and a new crisis over its anti-nuclear policy, which should help the conservatives hold their thin majority.

Party leader Neil Kinnock, who campaigned personally in Kensington before leaving on a trip to southern Africa, has renewed warnings to Labor's left- wing dissidents that the party must moderate its policies or risk its fourth successive defeat in the next general election.

''It is the realism that says when you have been defeated three times, then it is your duty to look at yourselves,'' Kinnock said recently of the review he has orderd of party policy.

Mrs. Thatcher has introduced laws to impose an unpopular new property tax, shaken up the welfare system and ordered a review of the cherished National Health Service in the next stage of her right-wing revolution.

Conservatives kept the seat in Kensington, which has 48,500 voters, with a majority of 4,500 in June 1987, when Mrs. Thatcher won her third term. It is the first House of Commons constituency to fall vacant.

The district is among the most starkly divided in Britain. In its southern part are rows of elegant period houses belonging to some of the nation's wealthiest people.

Kensington Palace is London home to Prince Charles and Princess Diana. Other royals, including Charles's aunt, Princess Margaret, and his cousin, Prince Michael of Kent, have apartments in the palace.

North Kensington, full of immigrants, is characterized by shabby streets of state-subsidized housing.

Labor has plunged in national polls from a narrow lead in April to 10 points behind in the lastest survey by the Market and Opinion Research Institute.

Bookmakers rate Conservative Dudley Fishburn, a former journalist for The Economist weekly magazine, a 5-1 favorite to win Kensington. His Labor opponent is Ann Holmes.

The by-election was made necessary by the death in November of Sir Brandon Rhys Williams, a Conservative who represented the constituency for 20 years.