President Reagan formally decided last Friday to endorse the House Ways and Means Committee's tax-overhaul legislation, but then withdrew the endorsement after senior White House officials had second thoughts, administration officials said yesterday.

Instead, White House chief of staff Donald T. Regan has ordered two quick studies of the impact of the legislation, while some of the House Republicans who object to it prepare an alternative they hope the president will endorse.

The on-again, off-again Reagan endorsement the day the committee was completing its work on the legislation reflects the divisions in the administration and in the Republican ranks over how overhauling the tax code should be handled.

Treasury Secretary James A. Baker III is pushing hard for mild presidential support of the bill, arguing that the endorsement can be withdrawn later as the legislation moves toward enactment. Regan, his top aide, Dennis Thomas, and others are counseling caution.

House Republicans, meanwhile, are considerating a partial restriction on the income-tax deduction for state and local taxes as part of their alternative, congressional sources said yesterday.

The restriction, which could exempt property taxes but wipe out the deduction for state and local income or sales taxes, would be used to offset the revenue lost from restoring tax benefits for energy, pensions, foreign business operations and investment incentives. Without such revenue increases, the GOP alternative would raise the federal deficit.

According to sources familiar with Friday's White House meeting, the president was given a decision paper offering five options. Present were Regan, Thomas, Baker, Deputy Treasury Secretary Richard G. Darman and the administration's congressional liaison, M.B. Oglesby. None of the five would comment on the options yesterday.

But others in the administration and on Capitol Hill said the president chose what aides described as the "move-the-process-forward" option, a statement endorsing the progress made on tax overhaul and suggesting the White House would work with the House and Senate to correct what it saw as flaws in the package.

After the meeting, officials said, Thomas had second thoughts, based on strong opposition from some House Republicans, particularly Minority Whip Trent Lott (R-Miss.). He also worried that a thorough assessment of the package had not been undertaken.

Both Regan and Thomas, officials said, feared that the president could have "egg on his face" if the legislation had unknown consequences that later were revealed. The planned letter endorsing the bill was shelved and a planned telephone call to Ways and Means' ranking Republican, Rep. John J. Duncan (Tenn.), was not made.

Separately, a White House official said spokesman Larry Speakes, among others, also had cautioned that such a quick response was not necessary. Speakes reportedly told aides that big mistakes had often been made previously after successful events such as the Geneva summit and that the White House could afford to wait before issuing a statement on the tax bill.

The administration is expected to issue a statement on the bill early next week.

Council of Economic Advisers Chairman Beryl W. Sprinkel and the Treasury Department have been asked to produce quick studies of economic aspects of the Ways and Means bill, and Oglesby is studying prospects for amendment to the tax plan in the Senate.

One White House official said that Reagan would endorse the House GOP effort only if it appeared he could not live with the Ways and Means version. The official said the question was unresolved, but "we can't keep it on hold too long."

One congressional aide involved in taxes said the White House delay in endorsing the package would hurt the chances for an overhaul approval by Congress. "Silence is deadly after a while," he said. "If you let it the bill hang out there, it begins to stink."

Republican leaders will not decide whether to introduce an alternative until early next week, when Congress returns from its Thanksgiving recess. But Ways and Means members Duncan and Rep. Bill Frenzel (R-Minn.) are working with Lott and Rep. Jack Kemp (R-N.Y.), among others, to produce a package that party members all can support. The committee minority staff is drafting the option.

"I don't know, and I don't think anybody does, what the administration will say," Lott said. "I assume they will say they have reservations but prefer the Republican alternative and hope the House will pass tax reform."

Lott said no decision had been made on whether to restrict the state-and-local tax deduction, which the committee bill retains in full and which Reagan's proposal would have wiped out.

The Ways and Means bill, like Reagan's tax proposal, cuts personal and corporate tax rates while curtailing numerous deductions to broaden the tax base. But the committee version has a top rate of 38 percent while the Reagan plan's top rate is 35 percent.

Nonetheless, on average the Ways and Means package would provide a tax cut for individuals. Figures released by the committee yesterday show that the legislation would cut taxes more or the same as the Reagan plan for those earning up to $75,000 and less than Reagan for brackets above that.