President Reagan, celebrating the 40th anniversary of the Marshall Plan on the eve of his departure for the economic summit in Venice, yesterday urged allied unity in protecting the Persian Gulf, facing the Soviet Union on arms control and stimulating economic growth.

In a White House speech, Reagan gently chided the allies for their less-than-full support on such difficult issues as resisting trade protectionism and guarding oil flow through the gulf amid the Iran-Iraq war.

For example, he appeared to single out Japan for criticism of its failure to open markets to U.S. goods.

"Some countries, which have taken full advantage of America's past openness, must realize that times have changed," he said. "Today, any country selling heavily in the United States, whose markets are not substantially open to American goods, risks a backlash from the American people.

"No country that closes its own markets, or unfairly subsidizes its exports, can expect the markets of its trading partners to remain open."

Reagan said he would also prod Japan and West Germany at the summit to adopt "growth-oriented domestic policies," as the United States has been seeking for some time. He also called on Japan to "clarify" at the summit details of its plan to provide aid to less-developed nations.

On the Middle East, Reagan said "forces hostile to the free world" will "eventually have their way" if "we sail to a distance and wait passively on the sidelines."

He said Americans are aware "it is not our interests alone that are being protected" by the U.S. naval presence in the gulf. "The dependence of our allies on the flow of oil from that area is no secret."

"Free men should not cower before such challenges, and they should not be expected to stand alone," he said. With the exception of Britain, the allies have been unenthusiastic about joining the U.S. military presence in the region.

Reagan's address was originally to be delivered in Rome as part of a state visit, but that was canceled because of the forthcoming Italian elections.

In the speech, he praised the allied decision to deploy intermediate-range missiles in the face of a Soviet buildup in the 1970s. He criticized the "vocal minority" in the West that said deployment would mean "all hope of arms-control agreements would be lost" and added that "western resolve is paying off."

Reagan cited "considerable progress" in negotiations on a treaty to eliminate medium-range missiles in Europe and said, "We may be on the edge of an historic reduction of the number of nuclear weapons threatening mankind."

Addressing diplomats, foreign policy specialists and administration officials, Reagan praised George C. Marshall and noted that the Marshall Plan and Truman Doctrine were approved by Congress despite "deep political divisions" in 1947.

Reagan also paid tribute to Clark M. Clifford, a Washington lawyer and adviser to presidents, for his role in the Marshall Plan, pronouncing his last name "Gifford."