NBC News came under sharp attack in Congress yesterday for broadcasting a prime-time interview Monday night with an American hostage in the hands of his Iranian captors.

In the latest skirmish of the international war of words, the television network was the subject of less explicit criticism from the White House, State Department and television competitors.

NBC's special program, "Hostage! First TV Iinterview," featured Marine Cpl. William Gallegos of Pueblo, Colo., in a question-and-answer session arranged and monitored by the Iranian militants who have occupied the American Embassy in Tehran and made prisoners of its staff for more than five weeks.

House Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.) called the broadcast "regrettable and dangerous," and added: "For NBC to fall into the trap of being used for Iranian propaganda, I just can't believe it."

O'Neill spoke to reporters following a breakfast meeting with President Carter, and said Carter's reaction was "exactly the same as mine." O'Neill said he was "bitterly disappointed" that the network permitted Gallegos to be "trotted out" in front of the Iranian and American people.

Other members of Congress also were highly critical. House Democratic Whip John Brademas (Ind.) expressed surprise that an American network would go along with Iranian ground rules for the interview, and complimented the other two commercial networks for refusing.

Sen. Edward M. Kennedy (D-Mass.) said he could not understand why NBC broadcast the interview, charging that it contained "a complete distortion" of his position on the deposed shah. Gallegos told NBC that, according to his captors, Kennedy had called for the shah to return to Iran. Kennedy has criticized the former monarch and questioned whether he should be permitted to remain here, but has not called for him to go back to Iran.

Presidents Bill Leonard of CBS News and Roone Arledge of ABC News said their networks had turned down proposals from the hostage-takers in Tehran last weekend for such an interview. Both the news executives said they would not have accepted the conditions that NBC News agreed to, especially the prime-time broadcast of a lengthy and unquestioned statement by a spokesman for the captors.

NBC News president William Small defended the broadcast as "an important contribution to understanding what is happening in Iran." He said overwhelming public interest in the program, which was estimated by NBC to have attracted 30 million viewers, was evidence of a great desire to know more about the treatment of the hostages.

"The alternative is to hide information . . . That's not what a free press is all about," Small said.

As evidence of its news value, Small cited the fact that The Washington Post account of the broadcast dominated the paper's front page yesterday and that The New York Times printed a partial transcript of the intervew in its late editions.

Talking with The Los Angeles Times, Small admitted that the circumstances of the interview were far from ideal, but said: "When you interview a hostage or a POW or whatever, they [the captors] don't say, "Take him to lunch; we'll wait outside'."

Among those who praised the program was Richard Gallegos, father of the 21-year-old Marine who was its principal subject. "I don't feel it was propaganda at all . . . We're very proud of him," the elder Gallegos said.

"The answers he gave could not have been dictated to him. The Iranians didn't know what the questions were going to be. I don't think he indicated favor for the Iranians at any time," Gallegos added.

Little concern was expressed by officials that the American public would be swayed by the pronouncements of "Mary," the young Iranian who spoke for the captors. Nor did officials consider it likely that the majority of the public was reassured about the treatment of the hostages, in view of the cautious statements and mixed signals from Gallegos.

The young Marine, in the opinion of several officials, came out looking much better than his captors or his interviewers. "What's wrong with the program," said a White House official, "is that NBC was interviewing and interrogating somebody in effect against his will and possibly against his own interests."

An underlying concern was that the Iranian captors are manipulating American news organization in a way that can be heavily exploited in case of the "international tribunals" or trials that various Iranian authorities have proposed. Statements from Tehran have suggested that the world press will be invited to such events.

The Carter administration has warned Iran against placing Americans on trial or "parading" them before tribunals. The State Department yesterday asked that Americans not agree to sit on any such tribunal to investigate the shaw's regime until the hostages are released.

Both White House and State Department spokesmen reiterated demands that independent third parties be given access to all the hostages.

White House press secretary Jody Powell said the NBC interview provided "no significant addition to our body of knowledge" about the condition of the hostages. He and State Department spokesman Tom Reston repeated Powell's statement of Monday night but the interview was "a cruel and cynical attempt" by the Iranians to divert attention from important issues involving the continued captivity and condition of the hostages.