In a highly unusual action, a federal judge has blocked a possible prosecution of a wealthy independent oil "middleman" in connection with an alleged plot to inflate the price of oil artificially.

U.S. District Court Judge Robert O'Conor Jr. issued a temporary restraining order that prevents U.S. Attorney J. A. (Tony) Canales and the Department of Energy from seeking an indictment, filing a criminal charge or seeking civil or criminal penalties against Albert Alkek, who has been under investigation by a federal grand jury since last summer.

In an extraordinary step taken at the request of Alkek's lawyer, Tom McDade, O'Conor issued the order without giving the government a chance to contest it.

The judge said he took the step because of the "substantial probability" that the government, were it to be notified, "would immediately seek to and would cnforce and apply" the DOE regulation at the heart of the grand jury investigation. If the governement were to do this, O'Conor said, Alkek might be deprived of the hearing on the motion for the restraining order that the judge held.

The regulation is a catch-all provision aimed at any practice, ranging up to bribes, that someone may take "to obtain a price which is higher than is permitted..."

In an additional action, O'Conor set a hearing, to be held in a few days, on a motion by Alkek for a preliminary injunction, which would delay prosecution indefinitely.

Canales, in a statement filed with O'Conor, said that the "proper time to challenge the propriety of an indictment is after it has been returned, and not before. The effect of the injunction would be to bar the lawful authority of the U.S. attorney and of the grand jury by application of unauthorized discretion."

In applying for the restraining order, McDade, of the prominent law firm of Fulbright & Jaworski, filed an affidavit claiming that unidentified DOE officials in Washington had admitted to him that the department regulation at issue is "inapplicable to a criminal investigation of the sort" under way here.

McDade also relied on the claimed delicate health of his client, citing a plea by heart surgeon Michael DeBakey that the attorney continue to do "everything possible to refrain from bringing disturbing matters before" Alkek. The elderly millionaire oilman's heart has been "severely damaged" and he should neither be made to give a deposition nor summoned as a witness, DeBakey said.

In Washington, an administration official said that "everybody knows" McDade has had the letter available for use "for a long time." Morrelover, the official asserted, Alkek, whose personal fortune has been estimated at between $150 million and $200 million, has contributed millions of dollars to DeBakey's research work.

The official also termed the successful motion for the restraining order, which was sought had granted yesterday, "a desperate strategem."

Last year, two oil companies effectively under Alkek's control pleaded no contest after indictments were issued in Houston by the U.S. attorney in connection with a case the government won against Continental Oil Co. pricing violations.

The two companies, M and A Petroleum Co. and Foremost Petroleum Co., have also been the subject of Energy Department investigations for so-called "Daisy chain" violations, where oil or oil products are resold at prices in excess of what is allowed under DOE regulations.

After pleading no contest, the two companies, also represented by attorney McDade, agreed to pay $100,000 in criminal and civil fines for pricing violations during 1973 and 1974.