Charles Johnson is a retired, 65-year-old foundry foreman who lives in a grim, 11-story public housing town near an industrial park. He has voted all his life for the Labor Party "because I'm working class."

But when Johnson goes to the polls today to vote for a new member of Parliament to replace the Labor M.P. for this district who recently died, he may cast his ballot for the Conservative candidate.

The reason -- race.

Today's vote will be the first test of the popularity of Tory leader Margaret Thatcher's recent call for an end to Asian and Caribbean immigration, and her new use of this issue is clearly shaking traditional allegiances on both sides of the major party divide.

Johnson, for all his feelings of loyalty to the Labor Party, says he feels Thatcher is "on the right track."

"We've let too many come into the country," he says. "There might be more jobs for others."

Like Frank Johnson many voters here are being pulled away from their traditional party loyalty -- as more than a score of interviews here has revealed.

Ilford, a suburb of London, is predominantly a community of small home owners with some 65,000 voters. Their semidetached houses are of a mock Tudor style, trimmed in bright purple, blue, yellow and orange. In a by-election such as this, Ilford would likely swing back to its traditional support for the Conservatives.

Moreover, the major party candidates insist that the central issues are bread and butter, that is, how Prime Minister James Callaghan's Labor government has dealth with rising prices, taxes and the standard of living.

Yet, lurking just below the surface is the racial issue raised by Thatcher.

Her phrasing was relatively genteel for a society where almost everybody feels guilty about an open expression of racist feeling. Nevertheless, her words have been understood in a harsher sense by both friend and foe, stirring deep feelings and threatening conventional party ties.

Says Frank Johnson, the longtime Labor voter, "I might vote for Bendall."

Vivian Bendall, a real estate dealer, is the tory candidate and his leaflet warns voters that "the Labor Party plans to relax immigration controls."

Johnson's neighbor, Isabel Bull, is a 72-year-old widow, a retired post office cleaner. She says:

"It's a bit much having them (colored immigrants) here with so much unemployment."

She denies having any fascist feelings. "There's good, bad or indifferent like anybody," she says.

Mrs. Bull is another life-long Labor voter and she says she will vote for Tessa Jowell, the social worker who is Labor's candidate.

But the immigrant issue raised by the Tories has found a target in Mrs. Bull and other elderly Labor voters who nostalgically recall that Britain was almost all white only a quarter of a century ago. They are Labor voters who might well stay home today, the basis of Bendall's exuberant belief that "there is lots of apathy in Labor areas."

Labor's problems are compounded by a candidate from the National Front, an openly racist fringe party that calls for the expulsion of all nonwhites.

Jowell, the 30-year-old Labor candidate, grimly denounces Thatcher for "giving respectability to feelings that give rise to racial tension and racial violence." She acknowledges that "some people who have always been Labor voters have been thrown by this."

Yet, neither she nor her 39-year-old Tory opponent are fully alive to a blacklash that is slowly building here and could cost Conservatives some votes too. A small and largely dormant Asian community, perhaps 1,600 voters, is stirring with alarm.

Moreover, Ilford's Jewish community, perhaps, 7,500 voters or more than 10 percent, largely small entrepeneurs and predominantly Conservative, is also troubled by Thatcher's position.

Her stand has probably killed a Tory effort to break Labor's hold among the immigrants by appealing to the many Asians who run small businesses.

Mrs. Chendrike Rugahni, 36, and her husband own a small corner grocery. In her six years in Britain, she has always voted Tory. Now, she remarks with apparent nervousness in front of white customers, "I'm undecided because she [Thatcher] spoke about immigration."

Rugahni's 19-year-old nephew, Pabari Mahesh, a student, is less inhibited. He cast his first vote for the conservatives in a local election, but now "I am switching." He won't say to where, but he does say it is because Thatcher "spoke so strongly, so much emphasis" on immigrants.

Among other things, Thatcher declared that immigrant culture threatens to "swamp" British democracy and British attachment to law and order.

If the Asian response is predictable, that of the Jews is not. Many of them started life in London's East End and came here when their small shops prospered. Most have been voting Tory for years and not a single switch was found by this reporter.

But there is an unease that could in time translate into defections from the Conservatives.

Martin Young, 28, owns his own cab and a pleasant semidetached house. He will again vote Troy because "nationalization and taxes have spoiled the initiative or people which is what this country needs."

On immigration, however, he says that Thatcher "did the National Front more good than they could have done themselves. When there's a scapegoat available, who knows what'll be next. In a depression, I'd be even more worried."

He can't quite bring himself to utter the dread word, anti-Semitism, but he nods agreement when it is mentioned to him.

A Gallup poll predicts a crushing victory for the Conservatives, and a similar defeat for the National Front.

Whatever the outcome, it now appears that Thatcher has let loose a new force in British politics whose consequences none of the politicians here have yet been able to measure.