REMARKABLY, the omnibus trade bill was transformed in the House-Senate conference into pretty respectable legislation. As it originally passed both houses, it was dangerously protectionist. It was full of election-year giveaways to a great variety of special interests, voted with total disregard for the damage they would have inflicted on other American producers and traders. But in the conference most of the bad stuff got thrown out and all of the good stuff stayed in.

That doesn't happen very often. The conference deserves applause as an example of congressional politics at its best. To whom is the credit owed? To most of the conferees, notable among them Rep. Dan Rostenkowski, the chairman of the Ways and Means Committee, Rep. Bill Frenzel and Sen. John Danforth. But the greatest contribution was made by the U.S. trade representative, William E. Brock, who worked mightily and, as it turned out, highly effectively to change the thrust of this bill.

The conference dropped the tendentious and illegal expansion of the definition of dumping. It abandoned the attempt to protect the domestic cement industry from its Mexican competitors. Earlier the bill would have held the Mexicans' access to low- cost fuel to be an unfair trade practice. The conferees thought better of that one, as they began to consider the long list of American exports with access to low-cost power and natural resources.

There are still some unfortunate things in the bill. Originally it contained heavy protection for the California grape and wine producers. The conference put a good deal of water in their wine, but even in its present diluted form that section of the bill will be a nuisance. Another section will reinforce President Reagan's restrictions on steel imports.

But to balance that, the bill also contains trade benefits to poor nations. It will authorize the president to negotiate free-trade agreements with other countries; negotiations with Israel are already under way.

Perhaps more important, the bill gives the president wider power to protect intellectual property rights -- patents, copyrights and trademarks. Several countries, among which Taiwan and Singapore are conspicuous, have developed a thriving trade in pirated goods. Fake Apple computers, for example, are sold widely in Asia. The bill will enable the United States to retaliate against the goods of countries that refuse to enforce international rights in these areas. More broadly, the bill usefully advances the concept of reciprocity in trade.

As it stood a week ago in both houses' versions, the bill was a threat to the American economy and American jobs. As it stands today, thanks to a highly unusual conference committee, it deserves the president's signature.