Exxon Corp., the world's largest oil company, yesterday reported its first-quarter profits rose 26.3 percent from a year earlier, to $1.06 billion, bucking the string of earnings declines recorded by most other oil giants.

Other companies reporting yesterday cited a drop in oil product prices for their big declines: Shell Oil Co., down 28.7 percent, Sun Co., off 27.4 percent, and Tenneco Inc., down 14 percent.

Earlier this week Gulf Oil Corp. reported a 37 percent earnings slide, Atlantic Richfield Co., a 14 percent drop, and Phillips Petroleum Co. a 33 percent decline. Marathon Oil Co., a division of U.S. Steel, had sharply lower operating income.

Exxon attributed its gain to lower spending on energy projects, higher natural gas prices in the United States and a 62 percent increase in foreign earnings.

The company also cited the benefits of a 93 percent increase in oil production in the North Sea and lower purchases of oil on costly long-term contracts.

Exxon's profit increase was bigger than expected on Wall Street, although analysts had said Exxon would report a better year-to-year comparison than most other oil companies because Exxon's profit a year ago was exceptionally depressed.

Exxon said its profit of $1.06 billion ($1.22 a share) compared with $839 million (96 cents) reported for the comparable period last year. The year-ago profit was its lowest for any quarter since the second quarter of 1979. Revenue in the quarter slipped to $23.71 billion from $26.84 billion.

"The substantial improvement over the depressed results of early 1982 is encouraging even though the operating environment of the petroleum industry remains unsettled," said Exxon Chairman Clifton C. Garvin Jr.

Exxon said it earned $512 million on U.S. oil exploration and production, up 6 percent. Its domestic refining and marketing operations broke even, compared with a profit of $35 million a year earlier.

Overseas, Exxon earned $586 million on oil exploration and production, up 55 percent. Its foreign refining and marketing business earned $92 million, up 130 percent.

Meanwhile, Shell said it earned $246 million (80 cents a share), compared with $345 million ($1.12), in the year-earlier period. Revenue fell to $4.65 billion from $4.84 billion. The company said its refining and marketing business lost $40 million compared with a profit of $34 million a year earlier.

Sun said it earned $90 million (76 cents a share), compared with $124 million ($1.03), in the comparable period last year. Revenue fell to $3.74 billion from $4.06 billion.

The company said it lost $20 million on refining and marketing, compared with an $11 million loss in the first quarter last year.

Tenneco Inc. reported profit of $111 million (70 cents a share), down 14 percent from $129 million (88 cents), in the year-earlier quarter. Revenue slipped to $3.60 billion from $3.77 billion.

Most integrated oil companies have reported declines for the January-March period, mainly because of intense competition for U.S. gasoline sales.