Defying a mounting wave of opposition in much of the Arab world, Egyptian President Anwar Sadat flew back to Cairo today determined to proceed with his "sacred mission" to Israel.

"I am going," Sadat declared following two days of talks with an angry and suspicious Syrian President Hafez Assad."I always mean what I say."

Assad, pronouncing himself "deeply hurt," said he felt Sadat's decision to visit Israel this weekend was "very dangerous to the Arab cause."

Two of Sadat's closest advisers, Foreign Minister Ismail Fahmi and Minister of State for Foreign Affairs Mohammed Riad, also resigned in apparent protest and dismay.

Sadat insisted, however, that he was not heading to Jerusalem to make a separate peace between Egypt and Israel.

"I am going to tell the Israelis in their own den: 'If you want to live in this area, well, here are the facts,'" Sadat declared.

Within hours of Sadat's departure from Damascus for Cairo, two bombs exploded here outside the Egyptian embassy. There was not immediate word on casualties. Egyptian also scheduled a special flight out of Damascus at 1 a.m. Friday for Egyptians who felt in danger here.

The Syrian government late today issued a formal calling on "Arabs everywhere to contain and foil the dangers expected to result from President Sadat's visit to Israel."

That kind of inflammatory language was hardly likely to sit well with Sadat, whose concern about his own position could not have been eased by today's resignations of two key aides.

Foreign Minister Fahmi, who played a major role in the Egyptian president's opening to the United States in the wake of the 1973 Mideast war, was the first to quit, announcing that he could no longer "share the responsibilities under these circumstances." Then when Sadat named Riad to take over from Fahmi, Riad also resigned.

Sadat finally appointed Dr. Butros Ghali, one of the two Coptic Christians in his Cabinet, as acting foreign minister.

The Egyptian leader's decision to become the first Arab leader to visit Israel also drew heavy criticism today from a number of hard-line Arab states and Palestinian guerilla organizations.

The largest of the Palestinian groups, Al Fatah, which is headed by Palestine Liberation Organization leader Yasir Arafat, termed Sadat's decision a "gain for world Zionism" and "against the interests and struggle of the Arab nation."

But the Arab world was by no means unanimosly opposed to the unthinkable trip.

Saudi Arabia was believed to have tacitly approved Sadat's historic mission and and Tunisian President Habib Bourguiba even sent his wife to Cairo carrying a personal message welcoming Sadat's moves "towards a just and honorable peace in the region."

In winding up their talks here, Assad and Sadat admitted the complete failure of their efforts to agree on a common negotiating position for possible Middle East peace negotiations. It was not clear, however, whether Assad will now attempt to undercut Egypt's determined campaign for a new Geneva peace conference, or settle for disassociating himself from the Israel venture.

With events in the Middle East moving at this dizzying and unpredictable pace, it was hard to find anyone willing to predict what might happen after Sadat makes his historic journey.

Clearly, Assad's hopes of achieving the elusive goal of Arab solidarity - and keeping the Egyptians from bolting off on a negotiating course of their own -lay in ruins.

Assad said he and Sadat spent little time discussing the possibility that Egypt would conclude a separate peace agreement with Israel, because Sadat has repeatedly pledged not to do that. But diplomats here described Syrian leadership as confused and upset because they were taken completely by surprise by the Sadat move.

"Peace is an objective for us and for our brothers in Egypt," Assad told reporters at Damascus Airport after a chilly farewell to Sadat. "But as we see it now, work for the cause of peace does not require a trip to Israel."

Sadat told a press conference here that the disagreement "doesn't mean a rift" between himself and Assad, but the atmosphere was suddenly reminiscent of the bitter feud that split the two countries during the Lebanese civil war.

Syrian newspapers were ordered not to print photos of Assad embracing Sadat on his arrival, and Sadat reportedly brought his own cook out of fear of what the Syrians would feed him.

Sadat, unusually snappish and agitated at his press conference, said that when he first broached the idea of a trip to Jerusalem, he did not try to guess what Israeli reaction might be because "I was going to propose it whether the Israelis agreed or not." He termed it a "sacred mission" to search for peace.

Sadat said he had told no one and consulted no one before making up his mind to seek the invitation to Israel and that no one but Fahmy knew about it before he announced it in a speech last week.

He said his decision to set aside 30 years of Arab policy and go directly to the Israelis became firm during his recent trip to Iran, Romania and Saudi Arabia, but "was cooking in my mind" for somet time.

Sadat said he was not planning to visit Saudi Arabia for consultations any time soon because it was not necessary. Though he did not say so, he clearly has the support of the Saudis for the spectacular move he is about to make.

It would be difficult to overestimate the impact on Saudi Public opinion of the sight of the head of an Arab confrontation state praying in Al Aqsa, the Islamic shrine whose return to moslem control is viewed by the Saudis as a holy cause.

A corollary to the Saudi approval, in the view of analysts here, is that Arab hard-liners are now likely to harbor new suspicions of a U.S.-Saudi Egyptian plot to make peace with Israel at the expense of Syria and the Palestine Liberation Organization. This is especially true since President Jimmy Carter is claiming some credit for the Sadat policy.

Assad, who the U.S. and the Egyptians had been working to woo into the camp of those supporting a negotiated peace, said today that his country would have to reassess its policies.