Senate Majority Leader Robert J. Dole (R-Kan.) said yesterday that legislation to overhaul the tax code is "hanging by a thread."

Dole's most pessimistic comment to date about the fate of President Reagan's chief domestic initiative underscored the make-or-break importance of this week's closed-door meetings of the Senate Finance Committee, intended to salvage the measure.

Dole, who said last week that he would try to assist committee Chairman Bob Packwood (R-Ore.) in reviving the tax legislation, said yesterday in a speech to the U.S. Chamber of Commerce that the panel "is a long way from getting a tax bill out," and, "We might not get a bill this year." Dole told reporters later that there is little time on the legislative schedule for action by the Senate, although he said he still hopes a tax-revision bill can be passed.

Packwood responded to Dole's remarks by saying, "All I can do is plug away here day by day . . . . If I can get a bill out, we have time. We will get a tax bill this year that will be called tax reform." Packwood declined to speculate on whether the Finance Committee could produce a bill by early May, when he hopes to return to Oregon to campaign for the primary.

Today, Finance Committee members are to attend the second of a series of private meetings Packwood called after the attempt to write a bill in open session broke down 10 days ago. At the first meeting, last Thursday, Packwood unveiled a staff-drafted, modified flat-tax plan that would cut tax rates to a maximum of 25 percent and do away with all itemized deductions for individuals.

Packwood said yesterday he plans to offer three to five more variations of that proposal in today's meeting, all of them carry low rates and limitations on deductions and credits.

The new options are expected to propose retaining a few widely used deductions, such as the ones for mortgage interest and charitable contributions. They also may call for raising the personal exemption for all taxpayers and dependents to less than the $2,000 Reagan wants and Packwood has previously proposed, reducing the top rate to more than 25 percent or cutting individual taxes more than the first plan.

Packwood is actively seeking the support of business groups such as the Tax Reform Action Coalition that favor the House-passed tax-revision bill, promising that his legislation will sharply reduce tax rates.