The House International Relations Committee voted yesterday to end this country's near-total grant of legal immunity to foreign diplomats and to set new rules under which most embassy personnel could be forced to comply with American laws and pay traffic tickets.

In the Washington area, the legislation would reduce the number of persons holding broad diplomatic immunity from an estimated 6,000 to about 2,200, plus members of their families.

Yesterday's action, which had support from the State Department, was believed to be the first instance in which legislaton to narrow the 187-year-old immunity law has moved so far in Congress. The measure is expected to reach the House floor for a vote next week.

Diplomatic immunity excuses most embassy personnel and their families from judicial processes in this country. Most nations in the world grant immunity to one another's diplomats. It is intended to permit diplomatic personnel to conduct business without harassment.

Although most foreign diplomats obey American laws, there have been numerous instances in which the law has been used to avoid paying parking tickets or claims for injuries or damages in automobile accidents.

The measure also would require diplomatic personnel to carry liability insurance on their automobiles.

Rep. Joseph L. Fisher (D-Va.) introduced an early versions of the immunity-narrowing bill after an incident last year in his home county of Arlington. A 19-year-old Arlington man was struck and killed by an automobile driven by a chauffeur for the Senegalese Embassy. No legal action could be taken.

In a similar case in the District in 1974 a prominent medical school professor, Dr. Halla Brown, was permanently disabled when her car was struck by another driven by Panama's cultural attache. Again, No legal action could be taken and Dr. Brown's medical costs have reached $250,000.

As redrawn, the measure has as its chief sponsor Rep. Dante Fascell (D-Fla.), chairman of the International Relations Subcommittee on Foreign Operations.

The measure would repeal a law enacted in 1790 that grants full civil and criminal immunity to so-called "diplomatic agents" - ambassadors and their top professional aides - as well as to their family members, administrative and technical personnel, embassy service staffs and all household servants brought here from abroad.

The total number of those covered by immunity has grown as embassy staffs have increased in size and the number of new nations has risen.

By repealing the 1790 law, the new measure would put the treatment of diplomatic personnerl fully under new rules spelled out by the Vienna Convention of 1961, an international meeting that modernized immunity rules.

The United States ratified the convention in 1972, but full enforcement of the new rules conflicted with terms of the old law.

Under the Vienna Convention, only the top "diplomatic agents" and their families would retain full immunity, Lesser official personnel would have immunity only as related to official acts.

In an action that could affect the enforcement of some traffic laws against embassy personnel, Mayor Walter E. Washington asked the D.C. City Council yesterday to enact a measure making improper and overtime parking a civil rather than criminal violation.

If enacted, this would mean that many lower-ranking personnel and their families could be made to pay for tickets that they otherwise would continue to escape even under the proposed new diplomatic regulations.