A new hard-line Israeli Cabinet seemed to be in the making today in an atmosphere inflamed by the feud between Prime Minister Menachem Begin and his out-going defense minister, Ezer Weizman.

The Israeli state radio reported that Begin had decided to move Foreign Minister Yitzhak Shamir into the defense portfolio and put Energy Minister Yitzahak Modai in charge of foreign affairs.

In contrast to Weizman, who resigned accusing the Begin government of "marking time" and missing an opportunity to bring peace through meaningful negotiations with Egypt, both Shamir and Modai are noted hard-liners.

Shamir, 64, abstained when the Israeli parliament approved the Israeli-Egyptian peace treaty. He and Modai, 53, have been staunch advocates of Israeli settlements in the occupied Arab lands.

The reported Cabinet changes could not be officially confirmed. But political commentators here are increasingly questioning the ability of the Begin government to survive. It has been weakened by Weizman's resignation and that of foreign minister Moshe Dayan seven months ago.

Shamir, who was appointed foreign minister three months ago, has no military or technical background, usually required for the defense portfolio. Both his and Modai's reported appointment have been questioned with Begin's own coalition.

Tonight, Abraham Melamed, deputy of the National Religious Party, which is a part of the coalition, was quoted in a radio interview as saying that the appointments resembled the decision of Roman Emperor Caligula, who appointed his horse to the Roman Senate.

However, Modai is a key member of the Liberal Party and his appointment appears to offer some political advantages to Begin. A Liberal caucus tonight decided to insist that Begin publicly confirm the reshuffle.

In the reported reshuffle, another Liberal minister, Moshe Nissem, is scheduled to take over Modai's place at the Energy Ministry.

Meantime, begin's agriculture minister, former general Ariel Sharon, has threatened to quit the Cabinet if he is not selected to replace Weizman at the Defense Ministry. Sharon handed a letter to Begin tonight but its contents were not disclosed.

Sharon has been the most vigorous advocate of a policy of stepped-up Jewish settlements in the West Bank and Gaza Strip, the territories Israel captured during the 1967 Middle East war.

Weizman has opposed settlement in the occupied lands where about 1.2 million Palestinians live. The settlements policy is intimately tied to the question of Palestinian autonomy in the currently stalled Egyptian-Israeli talks. Weizman was reported to have rejected Israel's position in the talks. t

Political analysts here say that Weizman hoped through his resignation to force new elections. A poll published today in the Jerusalem Post showed 55 percent of 1,302 persons surveyed said they wanted early elections.

Earlier polls suggested that an election at this time would devastate the Begin coalition and sweep the opposition Labor Party back to power. The next parliamentary elections are scheduled for November 1981.

Weizman's resignation and his bitter public exchange with Begin continue to dominate the front pages here. But Weizman canceled without explanation a scheduled news conference today. An Israeli reporter who talked to him said the former defense minister said he hopes to make a political comeback when Begin's government collapses.