The House Ways and Means Committee yesterday approved legislation to ban all imports from Iran, two days after the Senate voted unanimously to do so.

The bill is expected to be sent swiftly to the full House, where approval seems assured.

Like the Senate action, the House measure is largely a response to recent reports that Iran has become the nation's second-largest foreign oil supplier.

But because the Senate measure is included in a defense-authorization bill that President Reagan may veto, it is not clear whether it will become law.

Nor is it clear that if enacted, a trade ban would have much effect, with experts saying that Iranian oil can be rerouted through European suppliers to avoid the restriction.

The House measure may include authorization for negotiating a multilateral Iranian-oil ban to overcome that difficulty.

It would become effective on the date of enactment, but give the president authority to delay implementation for up to 180 days. After that, the ban would go into effect unless blocked by congressional action.

The House measure differs from the Senate's in that it allows the president to lift the ban by certifying to Congress that Iran had stopped all belligerent acts.

The congressional moves were partly in response to reports that in July, the United States imported 19.6 million barrels of Iranian crude oil costing $359 million, accounting for more than 11 percent of U.S. oil imports. The surge came as prices of Iranian oil fell temporarily and U.S. companies increased their stocks in response to Persian Gulf tensions.

Some committee members expressed concern over making policy so quickly and with little debate. Several said they may object to bringing the bill to the floor under suspension of normal procedures.