BERLIN (AP) _ East Germany and the Western allies are deadlocked over the communist country's new policy requiring diplomats to show their passports as they cross between East and West Berlin, sources said.

Sources in East Berlin said that a change in the policy was ''out of the question,'' but added that the East German government did not want to escalate tensions.

In the past, the diplomats showed only their identity cards to East German guards as they crossed between the two parts of Berlin. The communist government has said the new policy is intended to fight terrorism.

Western diplomats, however, have said they fear the East Germans are trying to erode the Western position in the divided city, and that showing their passports at the Berlin boundary would amount to recognizing East Berlin as a part of East Germany.

The Soviet Union administers Berlin's eastern sector under an agreement concluded by the victorious Allied powers at the end of World War II.

The United States, Britain and France, which are exempt from the new rule because of their special status as administrators of the western part of Berlin, agreed Friday during a meeting of NATO foreign ministers in Halifax, Nova Scotia that they could not support the East German action.

At the Halifax meeting, the foreign ministers of the 16 member nations of the North Atlantic Treaty Organization also underscored their support for freedom of movement in Berlin.

At a Friday meeting at the British Embassy in East Berlin, NATO allies said they would continue to resist the new measures.

''There's no sign of any splitting of the ranks on this issue,'' said one Western source, speaking on condition of anonymity.

Resisting the measure means that diplomats wanting to go to West Berlin must make a detour of about an hour through East Germany, so they can enter across a recognized international border.

A Western diplomat, also speaking on condition of anonymity, called the East German policy ''schizophrenic.''

''We can't understand why the Berlin boundary should have the status of a demarcation line for the Allies and be an international border for us,'' the diplomat said.

A spokesman for the West German mission in East Berlin, Eberhard Grazhoff, said West German diplomats who tried to cross the boundary into West Berlin with just their identity cards were turned back for the fifth straight day.

He said the West German diplomats were under orders not to comply with the regulation.

U.S. allies also voiced their opposition to the passport checks on Thursday when the U.S. ambassador to West Germany, Richard Burt, met with the Soviet envoy to East Germany, Vyacheslav I. Kochemasov.

However, a Western source indicated that Burt did not raise a formal protest.

NATO ambassadors were apparently awaiting instructions on possible further action from their foreign ministers, who wound up their two-day meeting in Halifax on Friday.