President Reagan, declaring that the nation cannot "stay on the immoral, dead-end course of deficit spending," appealed to the public last night to support a compromise Senate Republican budget plan that would cut next year's deficit by an estimated $52 billion.

In the first nationally televised Oval Office address of his second term, Reagan said all the economic gains of the last few years are at stake in the scheduled Senate budget votes this week. "All our progress, all the good we've accomplished so far, and all our dreams for the future could be wrecked -- if we do not overcome our one giant obstacle," he said.

At the same time, Reagan warned that he would veto any tax increase and said he could not compromise further on defense spending. He called instead for a thick sheaf of domestic program cuts, including eliminating some activities, saying it was unfair in many instances to ask some citizens to finance benefits for others. The budget cuts are in some cases more far-reaching than those Reagan won in his first months in office in 1981.

He also defended a proposed limit on Social Security cost-of-living adjustments as a necessary sharing of the burden in reducing the deficit.

"We stand at a crossroads," Reagan said. "The hour is late, the task is large, and the stakes are momentous." He quoted President John F. Kennedy's call of 1961: "Ask not what your country can do for you, ask what you can do for your country."

The televised appeal came as the Senate was gearing up to begin voting today on the compromise. The spending plan was worked out between the White House and Senate Republicans after Reagan's first budget for next fiscal year fell flat when it arrived in Congress. White House officials said the first roll call would be critical because it would determine whether the proposal would hold together or be picked apart by affected interest groups. Regardless of the outcome, the Republican-controlled Senate faces further amendment from the Democratic-controlled House.

The president's address followed the central theme of his four years in office -- a shift in federal priorities away from domestic spending and toward defense while cutting taxes. It also followed past themes in laying all the blame for the record peacetime deficits of his presidency on domestic programs, many of which grew out of the Great Society legislation of the 1960s and '70s.

The president's speech also came against the backdrop of slowing economic growth. "Our economy is not that strong at this time," White House chief of staff Donald T. Regan said before the president's address. Only a few months ago, before the election, the president was saying economic growth would largely reduce the deficit; he did not make such a claim last night.

"The simple truth is, no matter how hard you work, no matter how strong this economy grows, no matter how much more tax money comes to Washington, it won't amount to a hill of beans if government won't curb its endless appetite to spend," the president said.

Acknowledging the shift in budget emphasis from domestic spending to defense, Reagan said the Senate plan "keeps what should be kept and cuts what should be cut."

The compromise package would terminate or phase out 20 government programs, including such popular ones as the subsidy to Amtrak. It would provide for major cuts in 40 other programs ranging from export subsidies to college-student aid and largely freeze the rest of the government's domestic accounts.

The plan would allow for 3 percent growth above inflation for defense spending. The deficit would be reduced from a projected $227 billion to $175 billion next fiscal year, and would decline to a projected $95 billion by fiscal 1988.

In his speech, Reagan returned to a favored anti-Washington campaign theme. He said much of the budget goes "not to the individuals needing help" but to "thousands upon thousands of bureaucrats, researchers, planners, managers and professional advocates." He said that "it is no accident that some of the wealthiest communities in America are the communities surrounding the federal government in Washington, D.C."

In the Democratic response to Reagan's speech, Senate Minority Leader Robert C. Byrd (W.Va.) accused Reagan of breaking promises to the elderly, imposing the burden of sacrifice unevenly on various segments of American society, and undermining the future of the country by shortchanging education and research.

"To be blunt about it, the president has not offered a solid financial plan for America's future," Byrd said.

He said Reagan in five years "doubled the national debt -- doubled the debt that it took 39 presidents almost 200 years to accumulate. He is the biggest spending president of all time."

"It is simply not fair, not right, that Social Security recipients are asked to sacrifice, and middle-income families are asked to sacrifice, and farmers are asked to sacrifice . . . and yet the largest, richest and most powerful corporations in America are permitted to get a free ride," Byrd said.

But Senate Majority Leader Robert J. Dole (R-Kan.) applauded the speech, which he had sought. "It was tough stuff -- just what we needed."

Reagan's address came at a time when aides believe he has the best opportunity of his second term to slow federal spending and eliminate popular programs, particularly if the economy later turns sour, as some expect, making deficit-cutting more difficult.

Recalling that 146 House members have pledged to uphold a tax-increase veto, Reagan renewed his vow to use such a veto on "any tax increase Congress sends me -- no matter how cleverly . . . disguised."

In response, Byrd said, "There are those who would have you believe that the Democratic response to the deficit problem is to raise your taxes. Democrats will actually oppose a personal income tax increase." However, he did not rule out a minimum tax on corporations, which some Democrats on Capitol Hill have been discussing.

Reagan used familiar arguments to counter demands for slower growth in the defense budget. "The Soviets are far more dangerous today than during the '50s and '60s -- periods in which we devoted far more to our defense," relative to the size of the economy, he said. The 3 percent growth above inflation provided for in the Senate compromise "is the rock-bottom level we must maintain for effective deterrence to protect our security," he said.

But the president already has compromised from the proposed 5.9 percent above inflation that he said earlier this year was the minimum necessary to protect national security.

Reagan said the Senate plan will "require canceling some programs" and "some nonessential military bases may be closed or cut back. But mainly we will continue to identify and eliminate waste and crack down harder on excesses in contract costs."

The administration has displayed growing sensitivity to charges of waste in Pentagon procurement, and Reagan said last night that "padding of expense accounts, overcharging for weapons, profiteering at the expense of the public -- these should be, and will be, prosecuted to the fullest extent of the law."

The president made brief mention of the reduced Social Security cost-of-living adjustment in the Senate plan. The new formula would provide 2 percentage points less than inflation for each of the next three years, but with a minimum annual increase of 2 percent. This is roughly half of what current law would provide, under the administration's current economic projections.

Reagan broached the subject by saying that "the burden will not be great if all of us help carry the load." He said that "our veterans, disabled workers, and retired citizens have earned their benefits. They deserve an adequate and dignified standard of living, and we will never renege on that pledge."

But Reagan did not mention his earlier promises, before the election, not to alter Social Security, or his postelection promise not to reduce the inflation adjustment. Democrats, who were not part of the budget compromise, have sharply criticized it on this point.

The Democratic Congressional Campaign Committee chaired by Rep. Tony Coelho (D-Calif.) has mailed to 200,000 donors a fund-raising letter saying the Reagan-Senate compromise on Social Security "is an outrage and nothing short of political betrayal."

Other Democrats, however, have joined in proposing some limits on Social Security cost-of-living adjustments.

Reagan also renewed his appeal last night for line-item veto authority. "Then I'll make the cuts; I'll take the responsibility -- and the heat," he said, adding, "and I'll enjoy it."

There has been criticism of further budget cuts in the plan targeted at programs aiding the poor, but Reagan said that "one area we will not touch . . . is the safety net for needy Americans."

In the Senate, Republican leaders hoped to exploit momentum from Reagan's speech by forcing a preliminary vote on the White House compromise, perhaps today.

Although the vote would be tentative, subject to subsequent up-or-down votes on individual spending proposals, it could give the Republican leadership an upper hand in trying to fend off amendments that could unravel the package.

If the plan is given preliminary approval, any proposals to restore funds would be designated as increases in the deficit, an extra obstacle for them to overcome.

But it was not clear last night whether the plan could clear this first hurdle or whether, if it did, the preliminary vote of approval would deflect moves thought likely in both parties for major modifications in the plan as a whole.

Win or lose, "it sets the parameters of how much strength we have . . . . We don't have a great surplus of votes," said Dole.

But Democrats were balking at the procedure, insisting on a chance to vote on individual spending cuts before agreeing to vote on the package as a whole. Dole put off the start of the debate until today when he could force a preliminary vote after up to seven hours of debate.

Republican leaders claimed that they were within striking distance of enough votes to pass the plan on a tentative basis, under which senators would be assured an opportunity to vote on specific items before final passage of the whole package. It's "quite close," said Sen. John H. Chafee (R-R.I.), third-ranking member of the GOP leadership, after a party caucus on the plan.

But Dole conceded last night that "we don't have the votes."