The oil industry, which has been reeling for months from sinking crude oil prices, this week recorded some dramatic increases in profits for a few fortunate companies, along with the expected losses.

One of the winners was Mobil Corp., which said its first-quarter earnings were 38 percent higher than the same period in 1985, a gain of $120 million.

Exxon Corp.'s first-quarter earnings were $390 million higher, up almost 30 percent from a year ago.

And Ashland Oil Inc. -- a domestic refiner and marketer that produces little crude oil of its own -- had a 179 percent increase in profits, or $25 million.

Oil industry analysts called the reports of soaring profits a one-time windfall that doesn't alter the overall picture of an industry forced to cut back operations across the board.

At some companies, the first-quarter profit gains were due in large part to the fall in the dollar's value, which almost has matched the plunge in crude oil prices since November. Many companies also profited because the prices of gasoline and heating oil, both in this country and overseas, have dropped more slowly than the prices of crude oil, from which the petroleum products are made. That gap helped Texaco Inc. report a 3 percent increase in first-quarter profits, to $328 million.

But the benefits of a cheaper dollar and falling petroleum prices have not been spread equally, as the first-quarter reports make plain.

For instance, oil companies with large overseas refining and marketing operations got the big benefits from the decline of U.S. currency.

Oil companies pay for crude oil in dollars, but receive local currencies when they sell gasoline and other products abroad, said Philip L. Dodge, an industry analyst with Donaldson, Lufkin & Jenrette. A cheaper dollar, compared with foreign currencies, meant a larger profit margin for Exxon, on sales abroad. "The change in the value of the dollar was so dramatic it had a major effect" on profits, Dodge said.

In Exxon's case, profits from its U.S. refining and marketing operations totaled $160 million in the first quarter, up from an unusually low level of $13 million a year ago. But the profits from its foreign operations soared even higher, to $447 million, from $16 million in the first quarter a year ago.

"The increase more than offset the decline in profits from oil and gas production" caused by falling crude oil prices, said Dodge.

Amoco Corp., whose first-quarter profits were 30 percent lower than a year ago, had no such overseas refining and marketing network to cushion the drop in oil prices. Its only foreign refinery is in Britain, and 300 of its 15,400 retail gasoline outlets are in foreign countries. In fact, lower oil prices forced Amoco to take a $44 million write-down on its oil inventories in Britain.

Most of the industry was in Amoco's shoes. First-quarter profits at Standard Oil Co. were $253 million, down 26 percent compared with a year ago. The Cleveland-based company has seen prices of its Alaskan North Slope crude oil fall by 50 percent since the end of 1985.

Pennzoil Co. yesterday said its first-quarter earnings totaled $42.3 million, also down by 26 percent from the same quarter a year ago.

The industry is nearly unanimous that the outlook for the second quarter is even grimmer.

Mobil Chairman Allen E. Murray noted this week that prices and profits from the production of crude oil and natural gas are lower than the first-quarter levels, while profits from marketing and refining are dropping as well. That means "sharply lower" overall profits in coming months, unless crude oil and natural gas prices rise.

Philip K. Verleger Jr., an energy consultant with Charles River Associates, said companies that haven't written down the value of inventories to reflect lower oil prices will have to do so between now and the end of the year, and that will cut a deep hole in earnings.

"I'd expect the second-quarter profits would be half the first-quarter results," said Dodge. The dollar's drop is a one-time benefit, and if oil prices move up this year, that is likely to cause an increase in the dollar's value, reversing some of the dollar-based gains of the past three months for companies like Exxon.

The oil industry's prospects for the second half of 1986 depend upon whether the Organization of Petroleum Exporting Countries is able to reach a firm agreement on new production quotas. Saudi Arabia's oil minister Ahmed Zaki Yamani said this week that he would be "very happy" if world oil prices stabilized at $18 a barrel by year's end, up from the current levels of about $14.

Many industry officials and financial analysts, anticipating an eventual OPEC agreement, believe an $18-a-barrel price is the likely outcome this year. That price would boost oil company profits somewhat above the current outlook, but not enough to reverse the steep cutbacks in exploration activities, industry experts believe.