The dollar plunged to record lows throughout the world yesterday while U.S. investors sold off stocks in near panic amounts in apparent uneasiness over President Carter's new anti-inflation program.

The spectacular market declines came as the White House braced for more bad news at home from both organized labor and the nation's major banks, which were expected to raise the prime interest rate again in the next few days for the second time in two weeks.

The AFL-CIO is expected to mount a major attack on the president's wage-guideline plan when its Executive Council meets today. Administration economists concede that labor's cooperation with the voluntary anti-inflation program is critical.

Yesterday's market actions overseas saw the dollar depreciate 2.1 percent against the West German mark, 1.9 percent against the Swiss franc and 1 percent against the Japanese yen. The dollar even depreciated against the Italian lira.

Gold prices, in the meantime, continued to soar as investors sought shelter from the currency wars. In London, gold prices rose more than $10 an ounce, to a record $245.12. And during the afternoon, New York gold prices climbed as high as $246.

On the New York Stock Exchange the situation was equally bizarre. After plunging nearly 18 points in the first hours of trading, the Dow Jones industrial average showed a gain of 5.80 ponts by the close of the day. But the gain in the Dow average masked one of the biggest selling days in the market's history. By the close of trading, 1.180 stocks showed losses, while only 443 registered gains.

The nation did receive some encouraging economic news yesterday. The Commerce Department's index of leading economic indicators, which is supposed to generally predict the future course of the economy, rose 0.9 percent in September. It was the largest rise in the index since April.

But in the crazy world of the investor there was already apprehension that the news might be too good.Administration economists expressed concern that the sharp rise might be seen by investors as a sign that the Federal Reserve Board would tighten interest rates even further in an attempt to slow down the economy.

Despite the torrent of mostly bad news, administration officials appeared firm in their belief that it will all blow over - eventually.

At least one official admitted, however, that the market reactions were "obviously not anyone's model of affirmation for this policy." At the same time, he said, "I don't sense any panic."

Assistant Commerce Secretary Frank Weil described the mood within the administration as one of "deepening concern combined with resignation to reality." He said that it's very hard to fight the tide and it is clear that the tide right now is against the dollar.

But Weil, echoing earlier public statements by Treasury Secretary W. Michael Blumenthal, said the administration was convinced that the government has taken the necessary steps to assure the dollar's recovery.

The view from outside the administration was not so optimistic, however. Otto Eckstein, a member of President Johnson's Council of Economic Advisers and a leading economic adviser to congressional Democrats, yesterday saw the nation headed toward recession.

"The odds for a recession are now even," Eckstein predicted.

He said the only way the Carter administration could stop the dollar's slide would be to take direct action against foreign imports. "We need massive intervention on international trade," he warned. "We need sharp restrictions on trade. We're being done in by our friends."

Eckstein said, however, that so far none of the president's economic advisers was willing to consider such action."

It was known, however, that the sharp slide of the dollar was beginning to create foreign policy pressures on the White House. Although White House economists are opposed to trade actions, there are pressures for some form of direct action.

There is a concern among some in government that the decline has generally reduced confidence in the United States among its major international partners. As a result, there is evidence of some growing pressure for direct action to save the dollar.

It is known that some government policymakers believe that the current export energy and anti-inflation programs will not be enough to stop the dollar's slide.

The pressure for direct action to save the dollar stem from the belief that the crisis has reached the point where it is affecting political relations between the United States, Japan and Western Europe. There is even some concern that it has begun to affect relations with the Soviet Union.

But even among the administration hard-liners there appears to be a willingness to wait and see if the markets are willing to take a second look at the anti-inflation plan.

The most immediate problem for the White House, however, is expected to be the rejection of its anti-inflation program by the AFL-CIO.

Although the federation's Executive Council will not officially take any action on the plan until later today, AFL-CIO President George Meany is reported ready to reject it. In its place, Meany will repeat his earlier call for full-fledged wage and price controls.

At least two key union leaders - Glenn Watts of the COmmunications Workers of America and Lloyd McBride of the United Steelworkers - are reportedly willing to reserve judgement on the anti-inflation program. But it is unclear whether either will even speak up in favor of the plan when the council meets.

Neither Watts nor McBride has to negotiate a new contract next year.

Two major independent unions - the Teamsters and the United Auto Workers - have given the Carter plan conditional approval. But administration officials readily admit that without the support of all of labor there is little chance the voluntary program can succeed.

In another development yesterday, Barry Bosworth, director of the Council on Wage and Price Stability, added a bit more gloom to the economic outlook. Speaking to a group of trucking company officials in New York, he warned that "we are going to have a pause in this economic expansion."

Bosworth's remarks, although there was little new in them, were attributed by some investment analysis as a major reason for the early slump in the stock market.

He said the economic growth rate for the next four or five years would range between 3 and 3.5 percent while the administration concentrated its efforts on fighting inflation.

Although the administration predicts that such a growth rate would keep unemployment from rising substantially higher than the current 6 percent range, it also would prevent any substantial reduction into the 1980s.