Prime Minister Menahem Begin unveiled his Middle East peace plan to the Israel parliament today and following a day-long debate won a surprisingly narrow vote of confidence.

Begin's proposals, which he ahd presented to Egyptian President Anwar Sadat during their Christmas summit in Ismailia, were endorsed by a vote of 64 to 8, with 40 ebsentions.

The plan called for full Israeli military withdrawal from the occupied Sinai Peninsula and its return to Egypt - contingent on Cairo's agreement to demilitarize the area - and provide for Palestinian self-rule on the West Bank of the Jordan River and the Gaza strip.

Begin insisted, however, that Israel would retain security responsibilities on the West Bank and in Gaza, and that Jewish settlements in the Sinai must be allowed to remain under Israeli administration.

The narrow vote was largely due to the fact that Begin's proposals were criticized from the right for going much too far and from the left for not going far enough. Even some members of Begin's Cabinet conceded privately that they were not sure the proposals were good enough to draw Jordon to the bargaining table.

Parts of the plan dealing with the West Bank problem also provided for a review of the arrangements after five years, an ambigous provision that some spokesman said would give Israel the opportunity to reconsider technical details.

Well-formed sources pointed out, however, that Palestinians were expected to view this provision as keeping ajar the door for an eventual exit of the Israeli occupying forces.

Except for an angry outburst by Foreign Minister Moshe Dayan, who at one point asserted that he would use the armed forces to prevent the creation of a Palestinian state on the West Bank, and a few impassioned speeches by the defectors from the Begin's party, the marathon televised debate was remarkable for its reasoned non-partisan tone.

It was the first time that all the major parties had given their deputies freedom to vote according to their individual conscience. A number of deputies of the opposition Labor Party, who had earlier said that they would vote for the Begin plan, changed their minds at the last moment, apparently angered by Dayan's outburst.

Ironically, in the course of the debate many speakers who eventually voted for the plan expressed reservations, and those who opposed it expressed regret.

On the crucial issue of the West Bank, Begin defended his provision for continued Israeli army presence in the area by saying that without it the entire plan would be "meaningless."

Among senior opposition figures, Labor Party leader Shimon Perez attacked Begin for having made too many concessions to Egypt - and too fast - on the Sinai Peninsula. Many government supporters are known to share this view. But former Labor Foreign Minister Abba Eban told reporters he thought that the plan was worthy of his party's support.

Begin had apparently hoped that by being generous to Egypt on the Sinai, he could get Sadat to be more accepting of the Israeli approach for the West Bank. Sadat has so far refused to endorse anything but the traditional Arab position that the West Bank must be free to choose independent statehood.

Begin disclosed today that the Israeli-Egyptian talks in Ismailia nearly founded twice over that issue. Other sources in a position to know confirmed this but said that, at another point, Sadat was nearly ready to accept Israel's general approach when he was dissuaded at the last minute by his diplomats.

In apparent reaction to that episode, Begin attacked the Egyptian Foreign Ministry in three separate passages of his opening speech for being "conventional," "antiquated," and "divorced from reality." For Sadat himself, however, Begin had nothing but kind words.

In his closing speech, Begin also had unusually harsh words for some of his formerly most devoted supporters - the Gush Emunim (Faith Block), which is devoted to establishing religiously oriented settlements in the West Bank.

While a few hundred settlers from the occupied territories demonstrated outside the Parliament, Begin said he had told the Gush Emunim privately, "You have developed a Messiah complex . . . We don't need monitors to insure the kosherness of our devotion to the Land of Israel."

Begin answered the defectors from his own party in a respectful subdued manner. "A hard and painful debate has been underway between my best friends and myself," Begin said. "We went a long way together in difficult days and in good days. I love them, and regard them - and shall continue to regard them - with affection.

Begin's toughness appeared to be bred of an effort to head off more defections among his own followers. One provision of Begin's 26-point plan for the West Bank was apparently added to placate those followers.

A highly knowledgeable source said that the statement that Israel does not renounce its claims to sovereignity over the West Bank and Gaza but proposes to leave the question open "for the sake of . . . peace" was not part of the original draft shown by Begin to President Carter.

The source said it was added, along with the number of provisions proposing an enhanced role for Jordan, after the lengthy Israel Cabinet debate following Begin's trip to Washington.

The plan is clearly designed to prevent the Palestine Liberation Organization from getting any foothold in the occupied territories. It provides, for example, for tripartite Israeli, Jordanian, and local Palestinian committees to set "norms" by unanimous consent - for the return of Arab refugees to the West bank and the Gaza District.

Armed with veto power, the Israeli could be expected to prevent the emptying out into the West Bank of the PLO-dominated Palestinian refugee camps in Lebanon and to prevent the retun of known PLO activists.

Informants here say that a number of points were left deliberately ambigious. In addition to the five-year review clause, the most important was a provision for Israeli-Jordanian negotiations over "questions arising from the vote to the Jordanian Parliament" by residents of the West Bank. The informants suggested that the negotiations with Jordan, although seemingly restricted to narrow range of questions to a very broad renegotiation of the whole Begin plan.

Indeed yesterday's mysterious disappearance of Dayan for more than 24 hours and confusing contradictory official explanations of it, are increasingly being linked to the Begin government's efforts to involve Jordan's King Hussein in the peacemaking process. Dayan is believed to have made a quick visit to Iran in an effort to enlist the shah's mediation.

Hussein is scheduled to visit Tehran for a meeting with President Carter on Jan. 1.

While the plan for the West Bank and Gaza was set out in detail in the published documents, the proposed Sinai arrangements were given less attention.

Meantime, former Prime Minister Yitzak Rabin said in an interview today that Isreal should try to hand over responsibility for the Palestinians to Jordan as completely as possible.

The point, he said, would be to get both Egypt and Israel off the hook of having t worry about the future of the Palestinians by involving Jordan in the matter. Once the links to the Palestinian question on the West Bank were assumed by Jordan, Egypt and Israel would be free to establish truly normal relations.