The House Ways and Means Committee yesterday turned its back on Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.) and voted to repeal President Carter's new oil-import fee, even if it is ultimately upheld by the courts.

Disregarding a threat by O'Neill to bottle up the resolution of disapproval in the Rules Committee, Ways and Means approved it 27 to 7.

There's little doubt that the rollback would win in a floor vote. House leaders already have conceded that there's a clear majority to repeal the import fee. There may even be enough votes to override a presidential veto.

However, O'Neill said yesterday the House will not take up the rollback resolution until a federal appeals court acts -- probably in July -- on a lower court decision that the fee is illegal.

Continuation of the fee, which was to have raised gasoline 10 cents a gallon May 15 had it not been blocked in court could prove to be a critical factor in congressional budget-balancing efforts.

The $4.62 a barrel would bring in an estimated $10.3 billion a year in new revenues, which the pending congressional budget resolution would earmark for a future tax cut. The money was to have served as a contingency fund.

The Senate Finance Committee voted earlier this month to endorse a similar rollback resolution, 14 to 4. The new crude oil tax bill Carter signed this year allows Congress to disapprove any White House action to limit oil imports.

Even if the House and Senate approve the rollback resolution the first time around, congressional observers say the real test will come on the vote to override an expected veto of the measure.

To override a presidential veto, supporters of rollback would need two-thirds of both houses. Some lawmakers have hinted they may support the rollback the first time around and back Carter on an override.