Congressional leaders yesterday virtually ruled out final action this year on President Reagan's plan to overhaul the tax code as they agreed to try to wrap up work this year by Thanksgiving.

"I don't think tax reform has any chance of getting through Congress this year," said House Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.) after a bipartisan leadership meeting to set the congressional agenda for the next few months.

The agenda not only fails to meet Reagan's demand for prompt action on tax reform but also includes trade legislation that appears likely to run afoul of administration objections.

Failure to get both House and Senate approval of a tax-reform plan in 1985 is considered by administration strategists as a serious, although not fatal, blow to chances of passage in 1986 or later.

Next year is an election year, and with all seats in the House and 34 in the Senate being decided, Congress, caught up in budget problems and other pressing issues, is considered less likely to tackle a major legislative project such as tax overhaul.

As congressional leaders worked out their agenda, Reagan continued to campaign for his tax plan yesterday in Concord, N.H. But he also emphasized the dangers of protectionism in the speech, reflecting a growing White House sensitivity to the congressional drive to restrict imports.

Standing on the statehouse steps, Reagan said, "America wants tax reform and America is going to get tax reform." And in a scene reminiscent of a campaign rally, he said there are "politicians in Washington" who say the American people "are not interested in tax reform." When he asked, "Are those politicians right?" the crowd shouted back, "No!"

The president did not put a deadline yesterday on getting a tax bill. Previously, he has said he wanted to sign such legislation by Christmas.

At least one key Democrat in the tax-reform debate, Sen. Bill Bradley (D-N.J.), still thinks Reagan will get his wish. "I don't think even the Republican Senate understands the dynamic that will start to flow in the country once you've passed tax reform in the House and you have a president, along with the Democratic House, pushing . . . ," he said.

While O'Neill said the House intends to take up the tax bill before adjournment, Senate Majority Leader Robert J. Dole (R-Kan.) indicated that prospects for Senate action this year were exceedingly dim.

Dole said it would take about two months to move the complicated overhaul measure through the Senate and a House-Senate conference, meaning "there's no way to finish" if the House, as expected, doesn't complete action on the measure until sometime in November.

Under the circumstances, "we've agreed we'll be out of here before Thanksgiving," said O'Neill. Dole suggested that putting off Senate action on tax reform would not necessarily doom its chances. He pointed out that Congress enacted tax bills in 1982 and 1984, both election years.

House Democratic leaders, anxious not to be blamed by Reagan for foot-dragging on the tax measure, have long taken the position that they would act on it this year. The House Ways and Means Committee met yesterday and agreed on procedures it will use in writing the legislation this fall.

But Senate Republicans have contended that there are more pressing priorities. Dole said earlier yesterday that the Senate could complete action on the tax bill only if the House could wind up its action on the measure by Oct. 15, which appeared impossible.

Although the priorities of the two chambers differ, the common agenda items agreed to yesterday were heavily weighted toward fiscal measures necessary to keep the government operating after the start of the new fiscal year Oct. 1, including a stopgap spending bill that was approved yesterday without controversy by the House.

Other items included fiscal 1986 appropriations bills, deficit-reduction legislation, a bill to raise the federal debt ceiling to $2 trillion, overhaul and reauthorization of farm programs, extension of the Superfund for toxic waste cleanup and final action on the defense authorization bill for next year.

Attending the meeting in addition to O'Neill and Dole were House Majority Leader James C. Wright Jr. (D-Tex.), House Minority Leader Robert H. Michel (R-Ill.) and Senate Minority Leader Robert C. Byrd (D-W.Va.).

"We pretty much agreed on the same things," said Dole.

Setting to work on one item on their list yesterday, the House approved, 272 to 156, a stopgap spending measure that provides interim funding for all federal departments and agencies once the 1986 fiscal year begins. The bill now goes to the Senate.

The omnibus spending measure, known as a continuing resolution, was needed because Congress has not completed action on any of its 13 regular appropriations bills for the new fiscal year. Without interim spending authority, the government would have to shut down.

The spending bill provides spending authority for government operations, generally at fiscal 1985 levels, through Nov. 14. Lawmakers said it is likely that Congress will not have acted on all 13 appropriations bills by that date and, instead, will have to approve a second continuing resolution to last through the rest of fiscal 1986, as it has done every year recently.

The bill was approved without a fight, largely because the period at issue is so short. This indicates that it may pass both chambers without the deadline crises that have often caused governmental disruptions in previous years.