The United Auto Workers union, on the heels of its victory to restrict Japanese automobile imports yet fearful of further job losses, said it will begin a major campaign for legislation requiring foreign and domestic car compaines with large U.S. sales to build nearly all of their autos here.

The campaign is in response to threats from U.S. auto companies that unless the powerful union reopens contract negotiations before talks are scheduled next year they will have to send more of their production to overseas plants, where labor costs are less. The push for local-content requirements also will be used to gain more plant investment here by Japanese auto companies, which enjoy more than a 20 percent share of the U.S. market even as domestic auto shares continue to plunge.

The Japanese have been reluctant to invest millions of dollars in plants here and say that, by the time their facilities would operate, U.S. domestic auto sales will improve considerably.

The Reagan administration has said it opposes local-content requirements and other aid to specific industries as being anti-free trade. However, some senators have said that they are monitoring Japanese car shipments to determine whether more aid for the auto industry is necessary.

"Some may object that our content proposal runs counter to the principles of free trade," UAW President Douglas A. Fraser acknowledged in remarks prepared for the Sixth Annual Automotive News World Congress in Dearborn, Mich. But he added that other trading partners haven't exercised free access to their markets.

"If other nations' policies prevent auto trade from becoming a two-way street," Fraser said, "our country cannot afford a one-way traffic jam of the unemployed."

Fraser also said that the auto companies have threatened to ship more of their business overseas unless the union is willing to renegotiate its contract before bargaining is scheduled next year.

"Content legislation not only will address the savaging of the American economy by the Japanese," he said. "It will also comfort the exporting of American jobs and capital by General Motors and Ford."

Fraser also sent another message to the Big Two automakers.

"We have no intention of reopening those agreements," he said. "Yet let me make it clear that the UAW fully intends to approach 1982 bargaining in a responsible manner. We are realists. We understand that bargaining doesn't go on in a vacuum. You have to face the economic realities that exist when you go to the table."

Fraser, who mentioned content requirements during his drive last year for import quotas, said yesterday he hopes that legislation can be introduced in Congress by this fall. It would require that by 1985 auto companies with annual sales exceeding 200,000 vehicles have at least 75 percent North American content in their fleet. In a move aimed at the domestic companies, firms with sales exceeding 500,000 units would have to have 90 percent North American content in their fleet, Fraser said.

The law would be phased in beginning with the 1983 model year, Fraser said.In addition, all vehicle dealers must improve access by domestic producers to their replacement parts market, Fraser said.