Japanese Prime Minister Yasuhiro Nakasone said today that President Reagan's recent decision to move against unfair trading practices by other nations, including Japan, was "a wise step" to counter protectionist pressures in Congress.

Nakasone, here for the United Nations' 40th birthday and a mini-summit later in the week with Reagan and other western leaders, acknowledged in an interview that Japan is at least partially to blame for the trade imbalance with the United States, and pledged "a maximum effort" on his country's part to solve the problem.

He added that Japan must try in the long haul "to change the Japanese economic and social fabric or structure so that it will be a harmonious one with the world."

The interview in his New York hotel suite took place against a backdrop of growing irritation in Congress over last year's $37 billion trade deficit with Japan, which is expected to reach $50 billion this year.

Last month the Reagan administration, attempting to forestall protectionist action by Congress, announced a new policy of tightened enforcement against trading violations and set up a $300 million fund to counter subsidized financing by other nations.

In recent weeks, the administration has filed complaints against Japan, South Korea, Brazil and the European Community, and is considering a dozen other unfair trading cases.

The United States also acted through the Group of Five major nations, including Japan, to bring down the value of the dollar compared with other currencies. Experts here and in Japan blame anywhere from half to two-thirds of the United States' $123 billion global trade deficit last year on the distortions caused by the dollar's overvaluation.

Nakasone refused to be drawn into a discussion of how Japan might retaliate against possible protectionist legislation that he said "would add dark clouds over the world economy."

Speaking both in English and through an interpreter, he said that even if such legislation is passed, "I believe the friendship [between the two countries] should not be affected."

Nakasone's comments about the changes needed in Japan, a Foreign Ministry official said, were an acknowledgement that inefficiencies in his country's distribution system that tend to limit imports would have to be eliminated.

In effect, this amounts to recognition of one of the West's main complaints -- that Japan has an efficient export sector but an inefficient, even backward, internal economy that it protects through various barriers against imports.

Nakasone implied that the time has come when Japan will have to shed some of its old cultural ways that protect its agriculture, retailing and distribution.

"Where we are not very efficient, we will have to quicken the process of change," a Nakasone aide said.

Nakasone said that "the Group of Five action [which has lowered the dollar's value and boosted the yen's] was a great success." He added that while it is not appropriate to state a numerical target for the yen, "the efforts to see the yen appreciate will continue" through intervention in foreign exchange markets. The yen has strengthened to about 216 to the dollar from about 250 earlier this year.

Other officials here with Nakasone said that any effort to boost the yen through establishment of controls on capital exports had been firmly ruled out.

Nakasone disputed the perception in Congress and among Americans in general that a large share of the deficit with Japan is caused by unfair Japanese tactics, including Japan's failure to provide the same kind of access for U.S. goods that the United States provides for Japanese goods.

He said that there "still is a lack of understanding among the American people" about the steps Japan already has taken to open markets and to expand its domestic economy so as to boost the level of imports. "I feel Japan is an open market second only to the American market," he said.

But he added that when President Reagan shifted ground under protectionist pressure from Congress, resulting in accusations of unfair Japanese trade practices in the tobacco and leather industries, among others, it was understandable. Nakasone generally defended these Japanese industries against the complaints, but he conceded that the manufacture of tobacco products in Japan "is still monopolized" by local companies.

And, in any event, he said that Japan would continue to implement the "action program" announced in July and the domestic expansion program announced last week.

The domestic package is intended to stimulate the Japanese economy and lead to more purchases of foreign goods. It includes more generous low-interest loans and incentives for local governments to float bonds for public-works projects.

"I say this," Nakasone said: "The dark clouds may be blinding the sun, but sooner or later this will pass."

Nakasone rejected complaints that Japan's domestic expansion program had been restrained by his government's determination to keep its deficit under control.

"It is the government's policy not to expand the budget deficit, and I will stand by that policy," he said. But he promised consideration next year of a basic reform of the Japanese tax system and of tax benefits for home-mortgage holders.

"We are also planning to implement a tax-cut policy, and we'd like to draw on the Reagan tax-cut policy," he said. "I have already asked the relevant council of the government to consider a drastic tax reduction in fiscal year 1987. These recommendations will be presented to me some time in the fall of next year."

Nakasone insisted that "an equivalent [trade rule] situation now exists between the two countries" for the most important items in telecommunications, electronics and medical equipment, three of the four areas that had been selected for intensive negotiations with the United States. He conceded that little progress had been made in wood products, the fourth area.

Nakasone said "there is no risk" that as a response to what has been called "Japan-bashing" by the United States, future leaders of his country might turn away from the close economic and strategic ties with the United States to form a new alliance with another major power such as the Soviet Union or China.

"In all polls, it is indicated that the most-liked country is the United States, and that will not change," he said.