A pipe bomb planted under a vegetable stand exploded and ripped through a bustling open-air market in a suburb of Tel Aviv today, injuring 21 persons, five of them seriously. It was Israel's worst bombing in 14 months.

A police spokesman said 50 Arabs were rounded up for questioning. Some were escorted out of the area to protect them from enraged Israelis.

In Beirut, both the radical guerrilla group Popular Democratic Front for the Liberation of Palestine and the Palestine Liberation Organization reportedly claimed responsibility for the attack. The Popular Democratic Front said the bomb was its answer "to Begin's policy of creating new settlements in Palestine."

Israeli Prime Minister Menachem Begin has said that he views the Israeli-occupied West Bank, five miles from the scene of the explosion, as historically Jewish land and that he favors establishment of Israeli settlements here.

The attack at the vegetable market in Petah Tiqva was the bloodiest terrorist bombing in Israel since May 1976, when a booby-trapped motor scooter blew up in Jerusalem, killing one person and injuring 29.

Police warned Israelis to be on the alert for new attacks. "We call on the public to watch out for suspicious parcels and people, especially in crowded public places," police spokesman Menashe Golan said.

Security sources said some sort of violent demonstration had been expected to mark the opening of the trial of two West Germans and three Arab guerrillas accused of trying to shoot down an Israeli airliner with a rocket in Nairobi, Kenya, last year. There was no indication, however, that the trial and the bomb blast were connected.

Israeli officials refused to divulge information about the secret trial, which is being held at an undisclosed place in Israel. A West German spokesman said in Tel Aviv, however, that it opened today and that an observer from the West German Embassy was attending.

West Germany complained in March that it had not been told of the arrest of Brigitte Schultz, 23, and Thomas Reuter, 24, for more than a year.

At the same time, West German officials confirmed press reports that the two had been held in connection with an attempt to shoot down an E1 A1 Boeing 707 with a Soviet-made Strella rocket as the plane was landing at Nairobi in January 1976.