House Speaker Thomas P. (Tip) O'Neill Jr. has placed trade legislation on a fast track by winning agreement from the Democratic leadership and chairmen of key committees to bring a comprehensive trade bill to the House floor by mid-May.

The agreement came at a meeting in the speaker's offices Wednesday night and is expected to be announced today in a letter to be sent by O'Neill.

By pushing a comprehensive trade bill to the House floor, O'Neill could successfully make record trade deficits a big issue for Democrats in this fall's congressional election campaigns. The Republican-controlled Senate also is wrestling with trade legislation; but, under congressional rules, it cannot act until the House has passed a bill.

Rep. Sam Gibbons (D-Fla.), chairman of the House Ways and Means Committee's trade subcomittee, said the leadership will try to prevent the legislation from being overtly protectionist.

Other Hill sources said, however, that the bill is likely to strengthen U.S. trade policies, enhance the government's ability to enforce laws against unfair trade tactics, and demand principles of equality of access and reciprocity in America's trade relations.

These all are likely to be considered protectionist by foreign governments that would be forced to accept them in order to sell in this market. President Reagan has warned, moreover, that he will veto protectionist legislation. In addition, Reagan's trade advisers have said bills that tie the executive branch's hands in negotiations face a presidential veto.

Other parts of the bill probably would push for monetary changes to ensure that the dollar doesn't remain out of balance in comparison with other major currencies. The dollar, which has fallen as much as 30 percent from its peak in the past year, is blamed for a major share of last year's $148.5 billion trade deficit.

The legislation will be knitted together from pieces of at least a dozen major pieces of trade legislation introduced in the House.

In addition to bills supported by Democrats, House Republicans also have a trade pacakge that is supported by the minority leader, Robert H. Michel (R-Ill.).

Majority Leader Jim Wright (D-Tex.) was given the task of overseeing the movement of trade bills through committees and refereeing potential jurisdictional disputes, especially one between the Ways and Means Committee, which traditionally is responsible for trade legislation, and the Energy and Commerce Committee, which has been asserting itself in the field.

Both Ways and Means Chairman Dan Rostenkowski (D-Ill.) and Energy and Commerce Chairman John D. Dingell (D-Mich.) were at the Wednesday night meeting, sources said, and agreed to avoid jurisdictional battles that could bog down the legislation.

The Ways and Means Committee, which will hold a seminar on trade at a resort in the Florida panhandle in mid-March, will hold hearings March 11 and March 13 on a telecommunications trade bill that is likely to be included in the House package, with other hearings to follow.

Telecommunications legislation is backed by many lawmakers who believe foreign protectionist policies are undermining the United States' competitive edge.