Competition is creeping back into the retail gasoline market as oil becomes easier to get around the world.

Service stations in the Washington area and across the nation are staying open longer hours and on weekends. While gasoline prices continue to climb, profit margins for both refiners and retailers are shrinking.

In the first three months of this year, gasoline use nationally dropped more than 8 percent below the levels a year earlier. As of the end of March, gasoline stocks were at near-record levels, up more than 15 percent from 1979, according to the American Petroleum Institute.

The big inventories have prompted some refiners to begin to make more gasoline available to their dealers. And the drop in use is pushing service station operators to stay open longer in an attempt to sell more gasoline now that they have it to sell. In the process, some dealers have begun to trim their markups to boost sales.

In Virginia, Maryland and the District of Columbia, experts say there has been an increase in the amount of gasoline available to dealers while sales have dropped. They caution, however, that the relatively large inventories may disappear when the heavy driving season begins next month.

"With conservation efforts and higher prices, too, some of the dealers who have been finding they have more gasoline to seel are finding they have to stay open longer hours to get rid of it," said James W. Heizer, executive director of the Virginia Gasoline Retailers Association.

Vic Rasheed of the Greater Washington-Maryland Service Station Association said that in January only about 10 percent of the stations in Maryland were open on Sundays compared to about 50 percent now.

"Gradually they've been stretching hours since early in March," Rasheed said. "We expect to see a whole lot more open in April."

Heizer said Virginia dealers are getting more gasoline from their suppliers. Last month Shell Oil allowed dealers 75 percent of what they got in March last year. Amoco has raised this so-called allocation fraction from 80 percent to 90 percent, and Ashland Oil told its dealers "they could have all they wanted for the month of April," Heizer said.

In Maryland, Rasheed said, at the beginning of March Shell's allocation fraction was 75 percent. It went to 80 percent on March 18, then 90 percent and is now at 100 percent for April.

Not only gasoline is in ample supply. Home heating oil and diesel fuel consumption is down about 15 percent from last year as a result of much higher prices and a warmer-than-normal winter. Stocks of those products at the end of March were 174 million barrels, the API said, up more than 50 percent from 1979.

Inventories of residual fuel oil, the heaviest of the refined fuels used by utilities and industry, are up by one-fourth while use is down nearly 16 percent. As a result, residual fuel prices are crumbling.

Venezuela, which exports large quantities of the heavy fuel to the U.S. East Coast, has cut its price by as much as $5 a barrel for high-sulfur residual fuel in the last two weeks. U.S. refiners, such as Exxon, have cut their prices, too, and there are reports some cargoes have been sold on the spot market for as little as $11 a barrel.

Venezuelan officials, in fact, were in Washington last week trying to convince top Department of Energy officials they should buy 20 million barrels of residual fuel, which would have to be stored in above-ground tanks, for the nation's Strategic Petroleum Reserve.

Purchases of crude oil for the SPR have been postponed at least until June 1981, by the Carter administration in order not to encourage further increases in world oil prices. Saudi Arabia also warned the administration not to add to the SPR if it wished the Saudis to continue to produce 9.5 million barrels of oil a day, one million more than their normal ceiling.

Meanwhile, crude oil stocks in the United States and in several other industrial nations are at record levels. U.S. crude stocks hit 362.5 million barrels at the end of March, according to the API, up about 50 million from last year. The International Energy Agency in Paris estimates crude oil stocks of major industrial nations stand at nearly 2.9 billion barrels, a record for the end of a winter and up 11 percent from 1979.

DOE officials said the unusually high crude oil and product inventories in the United States are dragging down the operating rates for refineries. "There's so much resid around," one official said, "refiners are running out of space. They have no choice but to begin to reduce refinery runs."

With crude stocks up in the United States and refinery runs down, oil imports have fallen significantly. So far this year, net imports of crude and products have averaged about 7.3 million barrels a day, down nearly 10 percent over the year. In March alone, net imports averaged less than 6.9 million barrels a day, far below the national ceiling on imports of 8.2 million barrels daily set by President Carter.

But the ample supplies -- some would say there is a temporary glut -- have not stopped some members of the Organization of Petroleum Exporting Countries from continuing to raise their crude oil prices. Crude oil output by OPEC has been cut more than one million barrels a day to prop up prices. Nigeria recently hiked its second-quarter prices by 51 cents a barrel to match Libya's $34.70. Iran has added $2 a barrel to bring its prices to the same range. The Saudis are still much the lowest with a $26 price.

The world average price is just about $30 a barrel.

Most experts, however, think these increases are the last before full storage tanks and dropping consumption around the world make further increases all but impossible.

In the United States, the phased decontrol of domestic crude oil prices will keep raising the cost of this crude to refiners until they reach world levels in October 1981. At the same time, refiners are now selling products made from crude oil that probably reached the United States in February or perhaps early March.Therefore not all of the most recent OPEC increases have yet found their way into the refiners' wholesale prices, but most of them have.

Crude costs will keep the retail price of gasoline and home heating oil rising even as refiner and service station markups continue to shrink. President Carter's new $4.62-a-barrel fee on imported oil will also add 10 cents a gallon to gasoline prices during May and June.