The Japanese government is considering lending China funds necessary to complete the construction of four major petrochemical plants as well as to facilitate the importation of crude oil needed to operate those plants.

The loan possibility was revealed by Saburo Okita, Japanese ambassador for external economic relations, who recently visited Peking after China announced it was cancelling or postponing construction of the four plants as well as work on a major steel mill project, the Baoshan works in Shanghai.

In an interview yesterday, Okita -- on an official trip to Washington to meet his opposite numbers in the Reagan administration -- stressed that his government is waiting to see whether China makes a formal request for such assistance.

But he said that "both China and Japan agree that the future of the two countries' relations is so important that both sides want to make sure nothing is done to damage the relationship."

Okita, a noted economist, was instrumental in planning the Japanese "economic miracle" of the 1960s, which made Japan a leading world economic power. He served as foreign minister in the administration of Prime Minister Ohira, who died last year.

There has been concern in Japan ever since China announced that a re-evaluation of its "four modernizations" program would delay or postpone work on the $5 billion Baoshan plant and the four petrochemical plants, also worth $5 billion.Japanese companies, which had contracted for about $1.5 billion of the modernization work, already had filled some equipment orders and were concerned at first that they might not be paid.

Large American projects, including a huge copper-mining project that had been undertaken by the Fluor Co., also have been shelved.

But after visiting Chinese Vice Premier Gu Mu, Okita said he was reassured that China, "which values its credibility . . . will make compensation payments according to international practice." Gu cited China's record of paying off its entire debt to the Soviet Union in the 1960s, Okita said.

In exploring with Gu and other Chinese leaders what had gone wrong with the original Chinese projections, Okita said it was explained to him that in the anxiety to improve consumer living standards, wages had been raised.

But at the same time, the ambitious construction program for new industrial capacity had resulted in a national budget deficit of 17 billion yuan in 1979 and a red-ink total of 13 billion yuan last year. (One yuan equals about 63 cents.)

Okita said that because Chinese officials believe that deficits cause inflation, "which if not checked would wipe out rising incomes and cause discontent," they cut military spending by 20 percent and capital construction monies by 40 percent.

A related factor is a growing conviction in China that estimates for future oil production have been far too optimistic, he added.

Gu told Okita that it may be difficult for China to maintain the current level of 500 million tons of oil production, and that by 1985 there may be a slippage of 10 to 20 million tons from that figure.

Chinese economic officials decided that with such a reduction it would be difficult to supply the oil needed by the four petrochemical factories.

Okita says that final decisions have not been made, but it is likely that at least part of the original petrochemical capacity never will be built.