Just as the automobiles and video machines of the Japanese have become mainstays of the U.S. economy, so now have their investment dollars.

In a fundamental shift in world financial flows, Japan is exporting a mammoth wave of dollars to purchase foreign stocks and bonds. Much of the money is going to New York, where it plays an important role in financing the federal deficit.

It is being likened to the flood of OPEC petrodollars that washed into Western financial centers a decade ago. Huge stores of dollars that Japan amassed through years of trade surpluses now are flowing to wherever they earn the best return.

Capital exports gained steam in the 1970s as Japan strengthened its industrial base and loosened controls on foreign exchange transactions. But last year, spurred by attractive interest rates in the United States, Japan shifted into high gear, mushrooming its capital exports almost threefold to a total of $57 billion.

Comparatively little is direct investment in Japanese-run factories. In a typical transaction in today's business, an Osaka insurance company buys U.S. Treasury bills, or a wealthy Tokyo family invests in floating-rate bonds denominated in dollars and offered in London.

"There's every reason to think it's going to continue to grow," said George P. Hutchinson, managing director of the Tokyo branch of Salomon Brothers Asia, a subsidiary of the New York firm.

Senior government officials in Japan often depict the outpouring as a timely service to the United States, where capital is in short supply. Yes, Japan is running an enormous trade surplus with the United States ($37 billion last year), they say, but the dollars are shipped straight back as investments.

In Washington, Japan's money is seen as a mixed blessing. It does tend to pull interest rates down, it is agreed, but it also pushes the dollar's value up and perpetuates Japan's trade surplus. It is a cycle that feeds on itself, because more surplus means the Japanese have more money to invest.

Washington and Tokyo periodically exchange inconclusive proposals on how to tackle the situation. In the meantime, the capital exodus mounts. In January, $3.5 billion left the country; in February, $4.7 billion, and in March, $6.6 billion.

The Japanese say the solution is simple: The United States needs to control the federal budget deficit, which has created its chronic shortage of funds. That drives interest rates up, to the point that U.S. government securities now yield between 4 and 5 percent more than comparable Japanese government securities.

Japanese investors, like any investors, want high returns. It is unfortunate some of them drive the U.S. currency's value up by selling yen to buy the dollars they want, officials here say. But they would not be in New York at all if the United States curbed the deficit and brought interest rates down.

Interest rates are low here as the result of a proverbial frugality (Japanese households saved about 18 percent of disposable income in 1982, compared with 6 percent in the United States) and a relatively slow economic growth -- about 5 percent a year, only half the rate of the boom years in the '60s and early '70s.

"We have more money than we need for that growth rate," said Seigo Nozaki, a senior deputy director general at the Ministry of Finance. Money is plentiful enough also for the Japanese government to finance its own deficit.

Controls on foreign placements by Japan's institutional investors were loosened in the early 1970s. However, many of them, including insurance companies and trust banks, are required to limit foreign holdings to 10 percent of their portfolios. Many are now pushing up against those ceilings and campaigning for a rise.

Even with those controls, the volume is enormous. In 1984, the Japanese plowed about $31 billion of new money into foreign securities, according to the Normura Research Institute. That dwarfed the other categories of capital export -- $6 billion of direct investment, $5 billion of trade credit and $12 billion of loans. With other minor categories included, total outflow was $57 billion.

During the year, foreign investors were unloading Japanese stocks from their portfolios. The only significant flow of term money into Japan was in bond purchases by foreigners, making total inflow only $7 billion. The result was a $50 billion net outflow.

At the close of 1984, according to Normura, Japanese commercial banks held about $18 billion in foreign securities, a 62 percent rise over 1983. Life insurance companies' holdings rose 31 percent to $15 billion.

The United States is believed to have been the recipient of about half of Japan's new securities purchases in 1984, with U.S. government paper being the most popular acquisition.

Many Japanese feel a bit uneasy with U.S. corporate securities. "So many takeovers, so many bankruptcies. It's a kind of a feeling -- they feel much better with U.S. government securities," said Susumu Fujimoto of the Finance Ministry's foreign capital division.

They feel better if they control management, however. The United States remains Japan's favored site for direct investment. As of March 31 last year, Japan had put about $17 billion into the United States in direct investment, according to the Ministry of Finance.

If U.S. interest rates don't come down, an alternate step would be for Japan to choke off the outflow, as some officials in Washington have called for. This presumably could be accomplished with "administrative guidance" to dealers or with an interest equalization tax that would wipe away the financial gains of going abroad.

"Our position is quite clear. We will never do that," said Nozaki.

Japan is now in the midst of sweeping deregulation of its financial sector, he said, and has no intention of turning back the clock. Doing so might have unforeseen results, such as destroying investors' confidence in the Japanese government and leading them to pull their money out of Japan, he said, driving the dollar's value up further.

Another option is for Japan to bring its interest rates up and undo a key element of postwar economic policy. This is equally distasteful. Japan credits low, stable costs of capital for much of its success. Higher interest rates would slow the economy, Japanese bankers argue, and reduce Japan's imports from the United States, which would widen -- not narrow -- the deficit.

The Japanese government, then, seems content to wait for action from the United States. It is doing well in the meantime; Japanese investors are earning good returns, and a cheap yen is making Japanese exports highly competitive.

A few Japanese, however, wonder whether it is wise to entrust so much of their nation's savings to foreigners. Some members of the ruling Liberal Democratic Party and some academics have suggested that Japan might do better by investing in future technologies -- even if return is low -- rather than taking short-term gains in New York.

In the meantime, the overseas business has meant boom times for foreign securities houses with offices in Tokyo. With their superior tie-ins to the U.S. secondary market, Wall Street firms with branches here have had a jump on the "Big Four" Japanese houses that traditionally control the market. "It's tremendous," said Hutchinson of Salomon Brothers Asia. Two and a half years ago, his office had eight people; now there are 45, with another 10 or so awaiting assignments in Japan. He attributes about half of that growth to the foreign purchase business.