PARIS, OCT. 21 -- Western Europe, already in the throes of the largest European migration since World War II, is expected to be flooded with millions more immigrants in the next two years because of deepening economic crises in North Africa and Eastern Europe, and Western governments are worried that the influx may exacerbate social unrest and overwhelm welfare programs.

Unlike last year's westward rush toward political freedom by nearly 1 million East Germans and other East Bloc citizens before the fall of communism there, the next wave of immigrants will be driven more by economic desperation and ethnic prejudice, according to demographers.

Many of the migrants may come from the Soviet Union, where exit visa requirements will soon be abolished. Destitute workers and besieged minorities from other parts of Eastern Europe are also expected to seek to move to the West, perhaps with the help of friends or relatives already settled there.

In addition, mounting economic problems in Morocco, Tunisia and Algeria are forcing a growing population of unemployed youths to emigrate in search of work. Many North African workers are circumventing the difficulty of obtaining visas by entering Europe illegally to take menial jobs at low wages.

The dual influx from the south and the east is already having a strong political impact on Western Europe, boosting the fortunes of right-wing parties intent on exploiting public resentment against the newcomers.

France's National Front and Italy's Lombard League have scored notable electoral gains, especially at the local level, by emphasizing tough curbs on immigration. In Austria, the right-wing Freedom Party raised its share of the vote from 10 percent to 17 percent in recent national elections by demanding new restrictions on the country's open-door policy that enabled 600,000 East Europeans to settle there in the last four decades.

Demographers and politicians say that as many as 5 million foreigners may flock to the 12 nations of the European Community in the next few years, joining an estimated 12 million to 14 million immigrants there now. While the immigration figures seem small when compared to the 320 million citizens in the 12 EC nations, the issue has become an emotional one because of popular fears that jobs, medical and welfare benefits, and even cultural identity, may be jeopardized.

The immigration issue poses a dilemma for many West European states. A steady influx of foreign workers is needed to sustain economic growth, compensate for Europe's low birth rate and fill dirty or dangerous jobs that many Europeans are reluctant to take. But governments are loath to cope with the volatile social climate that often arises when foreign minorities grow large enough to challenge the dominance of the indigenous population.

Earlier immigrants often are the most vociferous in their opposition to the arrival of outsiders. According to Bruno Etienne, a sociologist who teaches at the University of Aix-Marseille, some of the most fervent supporters of Jean-Marie Le Pen's right-wing, anti-immigrant National Front party are Spanish- and Portuguese-born workers living in Marseille who fear that their jobs and well-being may be jeopardized by new immigrants willing to work for much less money.

Similarly, Arab and African itinerant laborers were angered this fall when wine growers in the Beaujolais region decided to hire Polish and Romanian pickers to help with the harvest this year because they were willing to accept as little as $40 a day for the jobs.

The immigration controversy also raises serious complications for the European Community's plans to establish a single internal market for the free flow of people, goods and capital by 1993. Governments fear that eliminating national barriers will encourage more foreigners to gravitate toward the higher wages and better living standards found in Western Europe.

"Racism is getting a lot worse in Europe because of rising immigration," said Glyn Ford, a British Labor Party member who just completed a study on racism for the European Parliament. "A new underclass is forming and we have got to find ways to prevent these people from being exploited once the single European market is created."

Ford recommended that a "European residents' charter" be drafted to allow immigrants who are legally residing in one country to have the same freedom of movement throughout the community as do citizens. But it remains doubtful that all of the member governments will approve the idea because of the political sensitivity of appearing too lax on immigrants.

Etienne, an authority on immigration who wrote a respected study of Moslem infiltration into French society called "The Islamic Suburb," noted that intolerance regarding immigrants is not simply manifested along racial or religious lines.

He said German hostility toward Poles or Russians, or even Germans from the East, is often rooted in disdain for sloppy or less industrious work habits.

Etienne said that in the future, he expects there to be conflicts involving racial and religious differences between white Europeans and foreign blacks and Moslems, as well as tensions reflecting competition for jobs from skilled East Europeans. While noting that previous eras of massive migration in Europe, such as the 1930s, were rife with pogroms and other ethnic massacres, he said he was optimistic that violent upheavals could be avoided in the future.

Nonetheless, the European Parliament report offers a grim summary of a steadily increasing number of racial clashes throughout the 12 member states. The study also shows how the escalation of racial incidents coincides with the rising strength of right-wing parties -- now represented in the legislatures of France, Belgium, Germany and the Netherlands -- which advocate anti-immigrant legislation.

In France, where the number of immigrants is estimated at 4.5 million, or 7 percent of the population, a growing number of killings, bombings and acts of vandalism has been directed at the mostly Arab foreign population. Conflict between North African Arabs and the French police has become acute.

Twenty Arabs have been killed in "accidents" with the police in recent years. The fact that none of the lawmen has been punished is a source of rancor for the Arab population.

The report also said that as many as 70,000 racial attacks occur each year in Britain, largely perpetrated by the neo-Nazi "skinhead" movement that has spread to other north European states. In Greece, Moslems often have been denied building permits and driver's licenses.

In Germany, polls indicate more than two-thirds of the population believe immigrants have unfairly exploited the social welfare system.