The chief of Honduras' military forces, Gen. Gustavo Alvarez Martinez, said yesterday it might be necessary for the United States to intervene with combat troops in the event of an attack on his country growing out of the intensified civil war in neighboring Nicaragua.

Ending a three-day visit to Washington at the invitation of the Joint Chiefs of Staff, Alvarez said he would like a commitment from the United States that it will "stand with us in the defending of democracy." If troops of the leftist Sandinista government of Nicaragua should attack, Alvarez said, his forces "can stand the first push," but after that "there might be the necessity for the United States to intervene."

Asked if this would require U.S. troops, he replied: "If there's war, the only thing that will solve a war is troops."

Two months ago Nicaraguan Defense Minister Humberto Ortega Saavedra publicly threatened that his country might retaliate against Honduran support for CIA-backed counterrevolutionaries fighting the Sandinistas in Nicaragua. However, Nicaraguan regular units capable of such attacks are currently reported to be positioned well away from the border.

The possibility that the CIA-backed "secret war" could generate a widening conflict was among the fears that led Congress last December to forbid U.S. aid to the Nicaraguan counterrevolutionaries for the purpose of overthrowing the Sandinista government "or provoking a military exchange between Nicaragua and Honduras."

Controversy has broken out on Capitol Hill about whether the Reagan administration is complying with this law, and a ban on further aid to the insurgent forces within Nicaragua is being considered in the House. The Reagan administration and Republican leaders are strongly opposed to such a ban, which is supported by many Democrats.

The Honduran military chief, in a meeting yesterday with Washington Post editors and reporters, said he does not expect an attack on his country by Nicaragua, saying "that would be the biggest mistake Nicaragua could make."

Administration officials said Alvarez brought up the possibility of such an attack in his meetings here this week, but a senior Defense Department official said the United States considers it "rather unlikely" that Nicaragua would take such action.

Such attacks "would not be in the interest" of the Sandinista regime in Managua, said the official, who asked not to be quoted by name, because the Nicaraguans "can't be sure how Congress and the United States would react."

The official said no definite pledges had been made to Alvarez about U.S. action in such a wider war in Central America, but that Alvarez is aware of the 1947 Rio Treaty, under which the United States could take military action to assist a Latin American nation under attack.

Defense and State Department officials familiar with the situation said cross-border "raids" or "incursions" by Nicaragua into Honduras--along with the stepping up of Nicaraguan-backed subversive activities in Honduras--seem more likely in the months ahead than a Nicaraguan invasion of its neighbor.

The intensity of the U.S. response to Nicaragua earlier this week, when all six Nicaraguan consulates were ordered closed and 21 Nicaraguan diplomats ordered out of this country after three U.S. diplomats were expelled from Managua on spy charges, suggests that the administration would take strong counteraction to any Nicaraguan operations in Honduras.

U.S. officials would not discuss contingency plans in case of wider conflict in Central America, but these are known to include the use of U.S. air and naval power, the stationing of a U.S. Air Force squadron in Honduras and the invocation of the Rio Treaty.

The Joint Chiefs, with whom Alvarez met during his Washington visit, recoil from the idea of committing American combat units to Honduras or anywhere else in Central America at this time. They fear they would be wading into the same kind of swamp they encountered in Vietnam and would lose the support of the American public in the process.

Partly in hopes of avoiding such a direct involvement, the chiefs are encouraging Central American leaders such as Alvarez to develop hard-hitting, light-infantry units to pounce on guerrillas within their countries.

Gen. E.C. Meyer, Army chief of staff, disclosed Thursday that the chiefs are giving "high priority" to a study of ways to make Alvarez's forces more mobile, including building up to six airstrips in Honduras for troop-carrying aircraft such as the Air Force's C130.

Alvarez confirmed yesterday that he had requested such help in his meetings with the chiefs, stating that he had four new airstrips in mind rather than six. He added that the United States had loaned him two C130s to ferry troops around his country but that he could not afford to buy any.

Alvarez said the transport planes are too big for Honduras' needs and burn too much fuel. He said he is seeking smaller, lighter and cheaper transports but did not specify from what country he expected to obtain them. Alvarez said his shopping list includes helicopters, antitank weapons and additional A37 troop support aircraft for defensive purposes, but that a wish for F5 jets and other attack weapons is not being pressed.

The Honduran general said, "I have stated the necessities of my armed forces to the Joint Chiefs. They share my worries about the menace. They will analyze everything that I have, they will confer with the higher-ups, and I expect in a short period of time I will have an answer."

Alvarez said Honduras has no money to pay for new materiel. Official sources said much of this week's discussion revolved around financial questions, including Honduras' difficulty in repaying loans for U.S. weaponry and materiel previously received.

Alvarez contrasted his inability to obtain and pay for weaponry with the situation of Nicaragua, which has been receiving infusions of weapons from the Soviet Union, eastern Europe and Cuba.

Alvarez, 45, who is considered by many as a more powerful figure in Honduras than the civilian president, Roberto Suazo Cordova, charged in The Post interview that more than 2,000 Honduran "terrorists and guerrillas" have been trained by the Nicaraguans, who "violate our territory" every day using Honduras as a weapons supply line.

"The Sandinista regime is our enemy," said Alvarez.

Saying that "there is a great potential for a popular insurrection in Nicaragua," Alvarez predicted that the conflict there could end within a year if the insurgent force continues to have U.S. backing and "a solid logistical base, dynamic and sustained."

The overthrow of the Sandinistas from within, he said, would be "the cheapest way to save Central America and make justice for the Nicaraguan people."

Alvarez declined to say in the interview that his country would make its territory available to help the insurgents next door. Nevertheless, Honduras has been depicted in press reports, as well as in charges by Nicaragua, as the rear base for the insurgent drive in Nicaragua.