Exxon Corp., the world's largest petroleum company, reported yesterday higher second-quarter earnings. The New York-based firm attributed the increase and to improvements in domestic operations and foreign-exchange transactions.

Standard Oil Co. of Indiana, meanwhile, reported slightly higher earnings. Also posting higher profits were Atlantic Richfield Co. and Ashland Oil Co. The oil firms cited increased production levels and higher U.S. prices for oil and gas as factors behind the improved earnings.

Exxon said estimated second-quarter earnings were $700 million ($1.57 a share) compared with $575 million ($1.28) for the same period last year. Revenues increased to $15.5 billion from $14.1 billion.

Earlier this year. Exxon had reported losses of $72 million for the first quarter due to foreign exchange setbacks. Several other oil firms also cited the U.S. dollar's weakness as a negative factor on earnings.

But in the latest quarter. Exxon said it had gained $22 million as the dollar showed slight improvement. Exxon spokesman Bill Smith said the firm had no strategy to deal with currency changes.

"We just don't play the foreign exchange game," said Smith. "If it happens good, it's good. If it happens bad, it s bad."

In addition, company officials reported a significant improvement in domestic operations.

"Earnings from exploration and production in the U.S. totaled $627 million in the first half of 1978, up 25 percent from 1977," said Exxon chairman C. C. Garvin. "The start-up of North Slope Alaska operations in approximately mid-year 1977 . . . contributed most significantly to the earnings improvement."

Higher natural gas realizations also contributed to the increased profits, as well as refining and marketing earnings in the United States, mainly due to higher prices and increased sales volume, Garvin said.

In the first half of 1978, the firm earned $1.38 billion ($3.09 a share) compared with $1.22 billion ($2.72). Revenues were $30.7 billion, up from $28.4 billion.

Standard of Indiana said second-quarter earnings rose to $282.7 million ($1.94 a share) from $277.3 million ($1.89) Revenues increased to $4.1 billion compared to $3.5 billion last year.

For the first half, No. 6-ranked Standard reported earnings of $535.2 million ($3.66 a share) against $521.5 million ($3.65). Revenues were $7.8 billion, up from $6.9 billion in the first six months last year.

Standard attributed the higher first-half earnings to record worldwide crude oil and natural gas liquids production, improved margin on domestic refined products and higher domestic oil and gas prices.

Standard attributed the higher first-half earnings to record worldwide crude oil and natural gas liquids production, improved margin on domestic refined products and higher domestic oil and gas prices.

Atlantic Richfield Co., Seventh largest of the U.S. oil firms, said earnings for the second quarter totaled $210.9 million ($1.73 a share) against $191.2 million ($1.57) a year before. Revenues gained from $2.86 billion to $3.13 billion. For the first half, Atlantic Richfield's earnings came to $361.2 million ($2.97 a share) on revenues of $6.06 billion. In the first half of 1977, profits totaled $336.5 million ($2.77) on revenues of $5.63 billion.

The company said the improvement in earnings resulted mainly from an increase in Alaskan oil production.

Ashland Oil Inc., No. 15, said net income for the third fiscal quarter ended June 30 rose to $43.5 million ($1.43) from $38.8 million ($1.30 on sales of $1.39 billion against $1.20 billion.