The western allies today refused to comply with East German demands that foreign diplomats display passports at crossing points between East and West Berlin in a sharp rebuff to an apparent ploy by the communist state to gain de facto recognition of East Berlin as its capital.

The East German government, with the apparent consent of the Soviet Union, announced last week that all diplomatic personnel would have to present passports when crossing from the Soviet-controlled sector to the western parts of the city.

The surprise decision evoked anger and dismay among representatives of the United States, Britain and France, which along with the Soviet Union retain ultimate control over the city under postwar occupation laws. The western allies contend that showing passports would undercut their rights and symbolically endorse East German claims that the Berlin Wall represents an international frontier.

The western allies are extremely reluctant to accept even seemingly minor unilateral changes in tradition and practice in the four-power control of Berlin for fear that the Soviet Union and East Germany will use them to further tighten access to the city, an enclave 110 miles inside East Germany.

State Department spokesman Charles Redman said in Washington that "the allied position in Berlin is based on the quadripartite status which ensures free circulation within greater Berlin. The boundary between the Soviet sector and the western sectors is a demarcation line, not an international border."

Redman said that the western allies "are still assessing the practical effects" of the East German move and "have taken the matter up" with the Soviets.

A senior western ambassador here, however, tonight called the affair "a tempest in a teapot."

The dispute began yesterday when communist border guards stopped diplomats from the West German, Italian and Danish missions in East Berlin from traveling to the western sector when they showed up at crossing points without their passports.

Diplomats from the United States, Britain and France today drove from East to West Berlin as usual, flashing only their red identity cards. When asked by border guards for their passports, the diplomats said that they were not carrying them, allied officials said.

After checking with superiors, the border guards allowed most of the envoys to cross Checkpoint Charlie and other crossing points. But in at least one case an American diplomat was forced to turn back, allied sources said.

Diplomats from other western embassies reportedly decided not to challenge the new East German order for now, and used a longer route, to enter West Berlin from East German territory rather than from the eastern sector of Berlin.

Beyond protesting the border action through their embassies accredited to East Germany, the western allies were refusing to deal with East German authorities because East Berlin is formally recognized only as the Soviet occupation sector.

"The East Germans have been trying to narrow our rights for years, but this appears to be first time they have insisted on diplomatic passports at the crossing points," said an allied envoy in West Berlin. "But there is no way we can accept this kind of action because it would undermine the very basis of our presence here."

Berlin-based diplomats said that foreign ministers from the key western allies were likely to discuss how to respond to the East German action when they gather this week in Halifax, Nova Scotia, for the spring ministerial council of the North Atlantic Treaty Organization.

But the diplomats discounted rumors that the allies might take the drastic retaliatory step of breaking off diplomatic relations with East Germany.

"There is a whole series of things we can do to stop this foolishness, starting with talking to our Soviet counterparts," an allied representative said. "But breaking off relations is something that our governments are still far from contemplating seriously."

The diplomats said there was no clear accounting for the timing of the East German action, which came two months before the 25th anniversary of the building of the Berlin Wall.

Western analysts said it was unthinkable that the East Germans would take such a step without Soviet approval. They speculated that Soviet leader Mikhail Gorbachev, who spent five days in East Berlin last month while attending the East German communist party congress, may have given his consent for the border crackdown.

In announcing the decision, East German authorities said it was being made in response to western concerns about security. The allies have stepped up identity checks to deter terrorism in the wake of a West Berlin discotheque bombing last month that killed two persons, including an American serviceman, and injured more than 200.

The East German rationale that they were responding to U.S. security worries was ridiculed by western diplomats as an excuse to justify a policy of seeking to erode rights and privileges of the three western allies, who share ultimate governing authority for all of Berlin with the Soviet Union.

Allied intelligence sources say they believe that the explosives and logistical support for the bombing probably came from Libyan and Syrian embassies in East Berlin.