Yigael Allon, Israel's foreign minister under the Labor Party government and advocate of exchanging terriroty on the occupied West Bank of the Jordan River for peace with Jordan, died today of a heart attack. He was 61.

Mr. Allon, one of the dwindling number of larger-than-life heroes of the Jewish struggle for independence in Palestine in 1948, died in a hospital in Alfula, where he was taken just two hours after escorting Egyptian Defense Minister Kamel Hassan Ali to Kibbutz Ginossar, his family home in Galilee. Ali was the first Eqyptian leader to visit an Israeli kibbutz. i

Although he suffered a serious heart attack five years ago, Mr. Allon's sudden death shocked Israelis of all political affiliations. He had been seen as a likely contender for the Labor Party leadership and, had he been successful, as the party's subsequent choice for premier in next year's elections.

Throughout his long and versatile political career, Mr. Allon seemed always to finish second best in crucial political tests, often behind his perpetual rival, Moshe Dayan, and more recently behind Labor Party chairman Shimon Peres.

Just last month Mr. Allon, a member of the Israeli parliament, announced he would challenge Peres as party chairman, but Peres won the endorsement of his party's leadership group by a 2-to- margin. Mr. Allon had planned to launch another challenge in the party's June convention.

During the long reign of Labor Party rule in Israel, Mr. Allon held a variety of government posts, including deputy prime minister, foreign minister, labor minister, absorption minister and education minister.

At times he was controversial, not only because of his advocacy of the famous "Allon plan" in 1967 under which heavily populated Arab areas of the West Bank would be returned to Jordan in exchange for a narrow security stip along the Jordan River but for other peace proposals that were considered "dovish" at the time.

In 1973, he triggered a controversy by suggesting that Israel should grant Jordan some sort of extraterritorial status in the Moslem quarter of Jerusalem's Old City.

Born in 1918 near Mt. Tabor, the son of Reuven Paicovitch, who was one of the pioneers of Jewish settlement in the lower Galilee, Mr. Allon attended agriculture school and Hebrew University before helping found the Palmach, the striking force of the Hasana Jewish defense force.

Mr. Allon helped defend Jewish kibbutzim during the Arab revolt of 1936-39, which was one of the most severe tests of the Jewish immigrant community's will to prevail in a hostile Palestine. During that period, the Hasana decided it would be better to develop an offensive capability against the Arabs, and the Palmach was started.

Under the tutelage of the legendary Jewish fighter, Yitzhak Sadeh, and later, the maverick British adviser, Orde Wingate, Mr. Allon rose in five years from private to a general and commander of the Palmach.

Before the 1948 war for Israeli independence, he sent his Palmach aides to displaced persons camps in Europe and Cyprus to teach young Jewish internees to fight and then smuggle them into Palestine in defiance of the ban imposed by British mandate authorities.

During the war, Mr. Allon fought on practically all the fronts, first in the Galilee, then in the central plains and finally as commander of the southern command. He directed the campaign that led to the capture of the entire Negev desert and part of the northern Sinai.

However, Primier David Ben-Gurion, under American pressure, refused to let Mr. Allon move farther south. Allon objected to the constraints, feeling his forces could have broken the Egyptian Army and compelled Cario to sue for peace.

Later, while on a visit to France, Allon was relieved of the southern command and replaced by Dayan, which intensified the rivalry that had developed when both men were Palmach company commanders. Mr Allon was also abroad on the eve of the 1967 Arab-Israeli war. His political allies were late in alerting him to return to assume the post of defense minister. That position went instead to Dayan and Allon missed an opportunity that might have led him to the premiership.

Part of Mr. Allon's political setbacks stemmed from his ties to the leftist Ahdut Ha Avodah wing of the Labor Party and the deep divisions between it and more moderate factions.

Yet Mr. Allon proved himself a thoughtful and cautious political figure. The Israel authors, Yural Elizur and Eliah Salpeter wrote in their 1972 book, "Who Rules Israel" that "Allon does not like extreme decisions. He prefers agreed solutions, even if they involve compromise. By nature, he is a man of collective decisions."

In 1968, prime minister Levi Eshkol named Allon deputy prime minister

Following Eshkol's death in 1969, Mr. Allon served briefly as acting premier until the appointment of Golda Mier. He was named foreign minister in 1974.