Prime Minister Menachem Begin, keynoting a marathon debate in parliament on the Middle East peace Treaty, invoked the memory of 12,000 dead Israeli soldiers and vowed today that there will never be a Palestinian state on the West Bank of the Jordan River.

"There will never be a Palestinian state in Judea and Samaria. We will never agree. We will never make it possible," Begin pledged in a fiery two-hour speech to the Knesset that was interrupted repeatedly by catcalls and shouting from leftist members.

Rhetorically addressing his remarks to Egyptian Prime Minister Mustafa Khalil, who last week said Egypt will stand firm on Israeli withdrawal from the West Bank, Begin said, "Dr. Khalil... Israel will never return to the lines of June 4, 1967.

"Dr. Khalil, please make it perfectly clear, united Jerusalem is the eternal capital of Israel. It will never be divided. It will remain united for generations to come."

[In Cairo, Khalil criticized Begin's remarks and observers said it appeared that both sides were laying out the positions they will take into the post-treaty negotiations. Story on Page A-20].

Similarly, he invoked Khalil's name to assure the Knesset that Israel will continue its policy of establishing Jewish civilian settlements in the West Bank and Gaza Strip, saying, "Settlements are part of the security setup of the state of Israel" and "the security of Israel is the center of our lives."

While some members of the parliament wondered aloud whether Begin was unnecessarily baiting the Egyptians practically on the eve of the treaty signing, the prime minister pressed on with the theme, apparently to assuage fears from within the pivotal National Reigious Party and other factions of the Likud coalition that the treaty inevitably will lead to a Palestinian state.

The National Reigious Party, which threatened a coalition crisis by opposing the treaty, withdrew the threat after reaching a compromise with Begin by which a continued debate by Cabinet ministers on the plan for limited self-rule for Palestinians will focus on several principles sponsored by the party.

They include a commitment to continued Jewish settlement, the use of Israeli Army troops to protect settlers and the principle that autonomy will apply to individual residents but not to the territory itself.

Begin touched on all of them in his speech, saying that Israel faces "serious problems" in the autonomy negotiations that are scheduled to begin one month after the expected treaty signing in Washington on Monday.

The debate in the Knesset is expected to last until early Thursday, with each of the 120 members ostensibly allowed 10 minutes, not including interruptions from the floor.

As virtually every major political faction has said it will approve the pact, the outcome of the vote is a foregone conclusion. Most estimates give the treaty 85 favorable votes, with 35 members abstaining or voting against.

When the original Camp David agreements were approved Sept. 28, there were 84 Knesset votes in favor, 19 against and 17 abstentions.

In his speech today, Begin dwelled on the post-treaty dangers still facing Israel, warning that while peace with the largest Arab neighbor will be ensured, there still "will be an eastern and northern front." He was referring to Jordan and Syria.

"The danger is great," said Begin, noting that Syria has 2,800 tanks, more than Egypt, and that "Jordan has a good army."

But, Begin said, reflecting on 30 years of war, "Why all these battles? Why all the fighting? Why not make peace?" Invoking the memory of the 12,000 soldiers who have died in all of Israel's wars, Begin said the purpose of the accord was to break "this vicious cycle."

The most raucous outburst during Begin's speech came when an Arab member of the Knesset, Tewfik Toubi, a Communist, exploded in anger when Begin referred to plans of "the murderous PLO" -- the Palestine Liberation Organization -- to sabotage the autonomy process.

Toubi leaped up and shouted at Begin to stop, but the prime minister, his face red, shouted back, "You are a slave of slaves," referring to Communists, and "you think this is a festive occasion, with President Carter?"

The latter reference was to Carter's appearance in the Knesset during the president's Middle East shuttle, when Begin was repeatedly interrupted by hecklers.

As six ushers gently but firmly removed Toubi from the chamber, he shouted at Begin, "You will pay for it!"

Ten minutes later, Begin had the Knesset laughing with anecdotes about his trip to Washington, until his remarks about Khalil and the Palestinian state touched off another outburst.

To Communist member Meier Wilner, Begin shouted, "If we have a Palestinian state, it would be a Soviet base. Is that what you want?"

When Wilner shouted back, Begin retorted, "Are you satisfied? Write a letter to Brezhney."

Opposition Labor Party leader Shimon Peres, who congratulated Begin and shook his hand, said his party would support the accord because "it is for the good of the people, not of the party, not of the faction."

But Peres said Labor would continue to press for "the right balance of the legitimate aspirations of the Palestinian people" and assurances that the West Bank and Gaza do not become a Palestinian state.

Challenging Begin's principle of individual autonomy over territorial autonomy, Peres asked, "How can you rule the territories and not rule the people themselves?"

Later, in an interview, Peres returned to the theme, saying, "How can you distinguish between a man and his house, a farmer and his field?" He said Egypt and Israel have contradictory understandings of autonomy, and predicted this would lead to trouble in the autonomy negotiations.

Throughout the night, as the debate wore on, only about a dozen members were in the chamber at times.