Deputy Energy Secretary John F. O'Leary yesterday gave Congress "total assurance" that the nation's supplies of heating oil will be adequate next winter.

"Our dedication to this proposition, that people are not going to freeze in their homes," O'Leary told a House hearing, "is such that if need be, we will take steps that could force disruptions in the supply of . . . gasoline and other oil products."

Because of recent data suggesting that refiners increased production of all oil products in mid-June, O'Leary predicted that the government would not have to order cutbacks in gasoline production to assure adequate heating oil supplies. But, he said, "We would have no reluctance . . to order [production] shifts" if that appears necessary later this summer.

The Energy Department reported yesterday that U.S. refiners operated at 87 percent of capacity last week, up from 84 percent earlier this month.

O'Leary yesterday called the increase "quite good news," but added the caveat that one week's data might be misleading. He said he would like to see refiners operating at 89 percent of capacity. To produce at a higher rate than that, he said, would require an unacceptable depletion of crude oil stocks.

O'Leary and an aide, Jim Peterson, said an Associated Press article published yesterday in The Washington Post among other publications was wrong in suggesting that crude oil production from U.S. wells dropped this spring.

They said the report was based on preliminary data that they consider wrong. O'Leary then produced a blackboard-sized chart indicating that domestic crude production is running about the same level as in 1978.

That answer prompted a new round of questions, pressed most strenuously by Rep. Richard Ottinger (D-N.Y.). If domestic crude production is not down, Ottinger asked, and crude oil imports are up from 1978 levels, why is the oil industry delivering less gasoline to its customers?

O'Leary said, as the major oil firmms have been saying, that gasoline production is below last year's levels because last year the industry had a larger reserve of crude oil to draw from during the summer months, when most drivers use more gas.

O'Leary's six hours on Capitol Hill yesterday - first in meeting with liberal House Democrats and then in the hearing on heating oil supplies - were punctuated by the sharp outbursts of criticism that have become commonplace whenever O'Leary or his boss, Energy Secretary James Schlesinger, visits the Capitol.

O'Leary generally has borne the criticism stoically, but yesterday's hearing exceeded his tolerance and he snapped back at his interrogators with an angry lecture blaming "stupid policies" laid down by Congress for the present energy troubles.

The man who sparked the O'Leary retort was Rep. Toby Moffett (D-Conn.). Moffet had his 10-year-old daughter with him at the committee table, and he was talking to her during most of O'Leary's opening statement. When it came his turn to ask questions, though, Moffett came alive and showered O'Leary with a torrent of angry remarks.

"I'm not an overly partisan person," Moffett said, "but the thing that disturbs me is that you . . . give us the conservative Republican line." The oil situation, Moffett said, could lead to "national turmoil that would rival the Great Depression."

"Congressman, I've got to tell you," O'Leary replied harshly, "it frightens me to hear you and other people in responsible positions making these statements."

O'Leary said that members of Congress, in discussing the heating oil situation, are "raising the apparition that the American people are going to suffer next winter . . . an absolutely false premise."

The suggestion that heating oil might run out next winter is false, O'Leary said, because the Energy Department has legal authority to force refiners to produce enough heating oil this summer to provide an adequate winter reserve.

The Energy Department has set a goal of 240 million barrels of heating oil, known to the trade as "distillate," in reserve by the start of the heating season in October.

That figure, like most energy-related numbers, is a subject of controversy. Public officials in the Northeast say the 240-million-barrel goal is far too low to meet the region's winter needs.

But much of the oil industry and some Carter administration analysts say that the department, responding to political pressure from the Northeast, has set an unnecessarily high goal - as much as 30 million barrels too high.

Setting the goal too high could put more upward pressure on world oil prices and increase the severity of gas shortages in the meantime, the analysts believe.

In sometimes heated arguments within the administration's interagency task force on energy, these points have been made, sources saidd:

DOE's 240-million-barrel inventory target is based on as assumed 3 percent increase in demand for heating oil when a several-percent decline is more likely.

The demand estimate is too high for several reasons, including use of an obsolete economic forecast showing a 3 1/2 percent expansion of business activity between the end of 1978 and the end of this year. With a recession on the way, business use of heating oil, more than half the total, should decline.

Sharply higher prices, not considered at all by DOE, should further curb demand for heating oil.

DOE took no account of the reduction in consumption that will result from higher thermostat settings that will be required in nonresidential buildings.

The DOE failed to take into account any savings in oil consumption achieved by switching heating oil users to natural gas. By DOE's own estimates, such switching would save several hundred thousand barrels of distillate daily.

Finally, nothing was subtracted for the general impact of conservation steps which for several years have been reducing by 1.4 percent a year the amount of energy needed to produce a dollar's worth of goods and services.

These administration officials have been arguing that a target of 210 million to 215 million barrels would be more reasonable and would minimize the economic impact of the oil shortage. CAPTION: Picture, Rep. Moffett uses an impromptu illustration to question DOE official at hearing. By James K. W. Atherton - The Washington Post