The chairman of the Senate Finance Committee warned yesterday that the controversial provision in last year's tax bill allowing corporations to buy and sell tax breaks will be repealed or significantly rewritten, and said any companies making such deals from now on do so at their own risk.

But Treasury Secretary Donald T. Regan instantly responded with a defense of the so-called leasing provision, which experts say will save corporations and cost the Treasury $27 billion between now and 1986 in its present form.

"It is my intention that any changes to leasing apply to leases entered into after Feb. 19, 1982, and to property purchased after this date," Sen. Robert J. Dole (R-Kan.) said in a speech to the Wichita Chamber of Commerce in which he warned that some changes will indeed be made.

"Thus, corporations entering into leasing deals after today do so at their own risk," Dole said.

Regan, however, breaking openly with his party's leading legislator on tax matters, said, "I believe it would be extremely unwise to repeal, in the middle of a recession, the leasing provision of the new tax law which is aimed at increasing investment, business expansion and the creation of jobs."

Reiterating President Reagan's support for retention of the business and personal tax cuts in the 1981 law, Regan said, "Repeal now could have a serious impact on such basic and distressed industries as steel and autos . . . . The leasing provision is a key element in the effort to increase growth and productivity in the economy and to provide more jobs."

Dole said Rep. Dan Rostenkowski (D-Ill.), chairman of the House Ways and Means Committee, also favors repealing or curtailing the corporate tax benefits.

"He shares my view that changes should be made to the leasing rules and indicated that it is a high priority for his committee," Dole said. A Rostenkowski aide confirmed this, but said Rostenkowski was not yet willing to commit himself to a firm effective date for any changes.

The provision allowing sale of tax breaks was put in Reagan's bill by the administration with almost no debate or discussion.

It allows companies to enter into paper transactions called "safe harbor leases." These are not leases as commonly understood, but vehicles for the sale of depreciation deductions and investment tax credits resulting from the purchase of new equipment.

The 1981 bill cut business taxes substantially, mainly by allowing more generous depreciation deductions. The leasing provision was justified on grounds that some companies, especially such weak ones as International Harvester and Chrysler, would owe so little taxes that the depreciation provisions would not help them. They would thus be in a worse competitive position after the tax bill than before.

But there has been mounting congressional opposition to the provision.

This developed in part after disclosures that prosperous companies also were benefiting from the leasing rules. The most spectacular such report was that Occidental Petroleum Corp., a highly profitable oil company that was already paying no federal income tax because of other sections of the law, "sold" tax breaks on $94.8 million worth of equipment to March and McLennan, a New York insurance and investment firm.

At least 17 bills sponsored by more than 35 liberal and conservative members of the House and Senate have been introduced to repeal the leasing provisions.

Dole announced that any curtailment would be effective yesterday to keep companies from rushing to beat Congress to the punch.

If Congress decides to amend, rather than repeal, the provision, most of the possible alternatives create as many problems as they solve.

One would restore the more restrictive leasing rules that applied before passage of last year's bill. Under these, the company owning the leased equipment had to have a positive cash flow from the transaction beyond the tax benefits involved.

In addition, it had to have 20 percent of its own money invested "at risk" in the equipment. And at the end of the lease, the company using the equipment, the lessee, could only buy it at a fair market value, not at a prenegotiated price.

The new law all but eliminated these restrictions. The company "leasing" the equipment in fact can own it. The lessor only "owns" the right to take tax credits and deductions. At the end of the lease, the company using the equipment can buy it for as little as a penny.

One possible objection to restoring the old rules is that weaker firms would again be at a disadvantage. It might prove difficult, however, to write a provision that would let weak companies in and keep strong ones out.