The federal government is proposing to keep for itself billions of dollars in overcharges it is recovering from oil companies because of the difficulty of returning the money to the customers.

The problem is in the hands of the Department of Energy and is likely to be around for some time, despite President Reagan's elimination of controls on petroleum prices.

More than 1,000 alleged violations of price and allocation rules are still under investigation by two Department of Energy enforcement offices. If all the allegationsare correct, petroleum product customers were overcharge $12.6 billion from August, 1973, to last January, the period when price controls were in effect. DOE officials have already reached settlements totaling $1.6 billion.

Once cases are settled, either through negotiated agreements or litigation, something must be done with the money, and that's where it gets tough. The Reagan adminstration is studying a General Accounting Office suggestion that cash recovered from oil companies should go directly to the U.S. Treasury if overcharged customeres cannot be "readily identified."

What that means is that companies like the airlines, who knew exactly how much jet fuel they purchased, what they paid for it and who sold it to them, are going to get some money. The little guy, who buys heating oil for his furnace or gasoline for his car, who doesn't use a credit card or has long since lost his stubs, is unlikely to benefit directly.

This is the same problem that Paul Bloom, the former chief of DOE's Office of Special Counsel, solved in February by giving $4 million in recovered overcharges to four major charities and instructing them to distribute it to needy people who had trouble paying their heating oil bills.

That episode, which surprised the new Reagan adminstration, ended when the charities were told to keep $3 million and return $1 million. Bloom's solution is being studied by the Justice Department to determine its legality. It clearly does not meet the new adminstration's criteria for handling the problem.

In fact, there was talk early in the administration of disbanding the enforcement effort, and the original Reagan budget for the year beginning Oct. 1 would just about have done that. But Energy Secretary James B. Edwards has promised Congress and reporters that "there will no amnesty" for those who violated price controls.

Reducations are taking place in Energy's enforcement staff as in many other federal offices, but the enforcement program is apparently going to come through the budget reconciliation process essentially intact, according to congressional sources.

"The vibes I'm getting now are, 'Keep up the work,' but nobody calls it good work," said George Breznay, director of Energy's Office of Hearings and Appeals. "It's regarded as something like pulling teeth; it's got to be done," Breznay's office is charged with figuring out how to disburse the money once it is recovered.

In the days of controls, DOE would simply order the offending gasoline station or oil refiner to roll back prices. "Even that was far from perfect," Breznay said. "If a service station cuts prices a few cents, then he might have the cheapest gasoline on the block and get a lot of somebody else's customers who had not been overcharged."

Settlements between the department and oil companies typically include the establishment of pools of money against which groups can file claims. Some groups are well equipped for this because they have good records and can demonstrate that they lost large amounts of money.

That's not the case with the auto owner. If her was overcharged two-tenths of a cent per gallon in 1977 and drove 10,000 miles in a car that averaged 15 miles per gallon, then his total overcharge that year would have been $1.33. The adminstrative costs of proving that overcharge and writing the check are a good deal higher.

The argument for sending the money to the Treasury if it cannot be precisely refunded is that everybody benefits, at least indirectly, through increased federal revenue.

Carl Carrallo, solicitor in the Office of Special Counsel, which is responsible for prosecuting overcharge alegations against the 15 biggest oil companies, said, "When we started the audits in 1977, we charted all kinds of permutations on how to win, but never gave a lot of thought about what to do with the money." How About 'Refunds' Through States, Utilities?

If excessive petroleum charges can't be returned directly to the customer, and if it is decided that the Treasury should not get them, where should they go?

The Department of Energy is seeking comments on several answers to that question, including these proposals.

Give the money to the states, with the condition that they find a way to pass it to the consumer, possibly through reduced automobile registration fees. "This does raise the question of adminstrative costs," Energy's George Breznay noted.

Give the money to electric utilities on the assumption that almost everybody uses and pays for electricity, and require the utilities to pass they money to their customers in the form of a credit on their electric bills. The biggest electric customers are large corporations.