Italy's Communist Party, the West's largest Marxist party and the second biggest political group in Italy, emerged as the main loser today in nationwide local elections, according to official counts and projections by an authoritative polling organization.

The voting, which was seen here as a major political test, also showed gains for the country's five-party, Socialist-led coalition in the voting yesterday and today.

"It is a vote that introduces a factor of stability into the Italian political situation," said Socialist Prime Minister Bettino Craxi of the results in the voting for regional, provincial and municipal councils.

With 90 percent of the vote for the 15 regional assemblies counted, official Interior Ministry tabulations showed the Christian Democrats winning 34.7 percent, the Communists 30.8 percent and the Socialists 13.1. The neofascist Italian Socialist Movement followed with 6.3 percent. Official tallies for the provincial and municipal councils are not expected until Tuesday.

However, projections from Doxa, which in the past have shown only minor deviation from the final, official results, showed the Christian Democrats winning 34.8 percent, the Socialists 13.5 percent and the Communists only 30.1 percent of the vote, one of the Marxist party's lowest tallies in recent years. In last year's European Parliament election, the Communists polled 33.3 percent, and in 1980 regional elections they took 31.5 percent of the vote.

Today's projections did represent a slight gain for the Communists over the general elections of 1983, when, running together with the small Proletarian Unity Party, they polled only 29.9 percent.

The Communists had hoped to duplicate their performance in last year's European elections when, a few days after the death of their longtime leader Enrico Berlinguer, they slightly outpolled the Christian Democrats for the first time. Party leaders said a repeat performance would have put them in a position to demand a role in the government.

The five coalition parties -- Christian Democrats, Socialists, Republicans, Social Democrats and Liberals -- polled 58.4 percent according to the Doxa analysis. This was less than their totals in the last local election, in 1980, but a net improvement over their collective results both in the 1983 general election and in last year's European vote.

No parliamentary seats were at stake in this election, which was held to elect most of the country's regional, provincial and municipal councils. But leaders of the coalition parties had campaigned strongly for a showing of popular support for the government, calling it necessary for Italy's future stability.

The coalition's success suggests that the Craxi government, already one of the longest lasting in postwar Italy, is likely to remain in power for the foreseeable future. Craxi's bid to remain in power until new general elections scheduled for 1988 is particularly strengthened by his Socialist Party's performance. The Socialists' 13.5 percent share of the vote compares favorably with the 12.7 percent it polled in 1980, 11.4 in 1983 and 11.2 in 1984.

The Christian Democrats also declared victory, having succeeded in regaining some ground from the seven-point loss they suffered in Italy's 1983 general election. But the party earned a smaller share of the vote than it did in the 1980 local elections and lost some seats in regional assemblies.

As the Communists took stock of their setback tonight, Berlinguer's successor, Alessandro Natta, blamed the party's losses on the "climate of alarm" fostered by the Christian Democrats and the Socialists and the fact that other parties had more money to spend. "And we're still the party of 30 percent," he said.