D.C. and U.S. Park police, anxious to avoid the head-knocking with demonstrators that put them on national television last week, used a flexible defense yesterday to successfully divert about 300 protestors from storming the Egyptian embassy.

The mob, angered over President Anwar Sadat's visit to Israel, briefly threw stones and sticks at the police who headed them off from the embassy. The demonstrators then walked down Connecticut Avenue toward the White House.

Deputy Chief Robert Klotz, himself hit in the back with a softball-sized stone, called out the riot police at the noon-hour confrontation, at 23rd and Q Streets NW a block from the embassy. He then decided to allow the demonstrators to move down Connecticut even through they had no permit, in order to avert further violence.

The demonstrators, shouting anti-Sadat and anti-Israel slogans and raising their fists, were met at Lafayette Park by a phalanx of U.S. Park Police carrying nightsticks and shields.

"This is a very sensitive area (the demonstrators' presence in the park) and you're way off base on this," deputy chief Hugh Groves, a badge clamped to his gray business suit, explained to one of the group leaders, an excited Arab swathed in the traditional Palestinian headdress, the hutta.

"My people are angry because they have no homeland," the leader, who declined to give his name, said in broken English. "let them get their anxious off."

Groves explained that they needed a permit, secured 48 hours in advance, to assemble in Lafayette Park. "It's very critical that you explain (this) to your people the right way." Groves said.

The leader, rebuffed in an attempt to meet someone in the White House, was allowed 20 minutes to explain that to his people also were clustered in a northwest corner of the park. About 75 park policmen stood shoulder-to-shoulder in front of the White House.

After more shouts of "Down, down with Sadat," and "Down with Israeli Zionism," the demonstrators, mostly excitable young men, quietly disbanded.

"We'll knock heads if we have to protect people or property," a D.C. Police spokesman said after the incident, "but in this case the field commander (Klotz) decided that they were orderly enough going down Connecticut avenue that they didn't present a danger to anyone."

Ninety-six demonstrators and 28 policemen were hurt last week during clashes stemming from protests over the arrival here of the Shah of Iran.

Of a dozen Arab demonstrators interviewed yesterday, none would give their names. "You see how the Iranians have to wear masks to protect their relatives in the homeland," said one, "we don't want to do that." The protestors said they had assembled from cities across the country, but few would say where."

They condemned Sadat's visit as a "sellout." Said one, "Israel does not exist. To go there is to recognize it exists." Others spoke angrily about a double standard of rights and liberties for Israelis and Palestinians now living side-by-side in what is called Israel.

The demonstrators had a permit to gather in a park at 22d and P Streets yesterday, but decided to march from there to the Egyptian Embassy at 2300 Massachusetts Ave. Police enforced a law prohbiting demonstrations within 500 yards of an embassy and headed them off at 23d and Q.

Several officers were struck there by stones yesterday police said, but none needed hospital attention. There were on arrests and no injured demonstrators, police said.

After dispensing a small group of the protestors joked with reporters. Asked how they would get to their home cities, one smiled, and said "We'll hijack an airplane." Another laughed that they would go by camel.