A state can't levy a property tax on ocean cargo containers that are owned, based and registered abroad and used exclusively in international trade, the Supreme Court ruled 8 to 1 yesterday.

The Constitution forbids such a burden on foreign commerce, Justice Harry A. Blackmun wrote in the opinion for the court involving California and Japanese-owne container-ship companies.

A California tax created risks of double taxation by the state and the federal government and of preventing the United States from "speaking with one voice" in regulation foreign commerce, Blackmun said.

Pointing out that American-owned containers aren't taxed in Japan, Blackmun wrote:

"California's tax thus creates an assymmetry in international maritime taxation operation to Japan's disadvantage. The risk of retaliation by Japan, under these circumstances, is acute, and such retaliation of necessity would be felt by the nation as a whole.

"If other states follow California's example (oregon already has done so), foreign-owned containers will be subjected to various degrees of multiple taxation, depending on which American ports they enter.

"This result, obviously, would make 'speaking with one voice' impossible.

California, by its unilateral act, cannot be permitted to place these impediments before this nation's conduct of its foreign relations and its foreign trade."

In a separate action, the court rejected a petition by some General Motors Corp. stockholders under which GM would be compelled to reimburse them for the $1.3 million they spent unsuccessfullu litigating a case from 1957 to 1973. The case arose from the former ownership of 23 percent of GM's stock by E. I. duPont deNemours Corp.

In addition to Japan, numerous other countries do not tax containers, which usually are ashore in a port area onlu long enough to be loaded or unloaded, and which came into use in the late 1960s. The durable containers are made of metal and equipped with easy-access doors. Their main advantages are high efficiency and resistance to theft and fire.

Last year, 12 countries-including Denmark, Finland, France, the Nethrlands, Norway, the United Kingdom and West Germany-expressed to the State Department their concern about the California tax. None of the countries taxes American containers using their ports.

Under the ruling, which reversed the California Supreme Court, Los Angeles County and the Cities of Los Angeles and Long Beach must refund to six Japanese shipping lines about $550,000 in taxes paid under protest for the years 1970 through 1972.

The dissenting justice, William H. Rehnquist, said he agreed with the containers could be taxed because they have a "substantial" connection with California, some of them being there all of the time, and of them being "habitually employed" there.