Former Virginia House majority leader James M. Thomson was asked to defend his record as a segregationist and Equal Rights Amendment opponent by an Alexandria citizens panel yesterday as he sought to win the group's endorsement for a Circuit Court judgeship.

Put on the defensive, Thomson said, "I can treat anyone . . . as fairly as I want to be treated myself."

"But will you?", asked one panel member.

"I will," Thomson said.

Grilled for nearly two hours, Thomson defended his controversial views, but said, "If you go on the bench, you cannot advocate political beliefs."

Reminded several times of a 1971 statement in which he said "I believe in a segregated society," Thomson made a variety of comments, but never retracted the position.

Thomson, 54, defended his participation in the so-called "massive resistance" movement against school integration during the 1950's, and told the panel, "The right to put yourself in a special group should not be denied."

Thomson defended his anti-ERA stance yesterday, saying it would "mandate things like women in the draft" and "has nothing to do with supporting women's rights."

Thomson's defeat from office last year was blamed on his opposition to the ERA, Yesterday Thomson disputed that, saying, "They (women) didn't beat me."

Aside from his political beliefs, Thomson's lack of trial experience has also been used to attack his candidacy. Yesterday, Thomson said, "I've practiced for 27 years. I have more time in legal experience than all the members who criticized me have been in the bar."

Thomson's appearance before the 13-member panel-which is purely advisory to Del, Richard R. G. Hobson, who is dissatisfied with the current method of selecting judges in Virginia-was his first since his application for the fudgeship exploded in controversy. Hobson has asked the panel to recommend three candidates for the seat being vacated by Judge Franklin P. Backus, who retires Feb. 1.

Thomson, a ii-year veteran of the Virginia House of Delegates and former Democratic majority leader there, is being opposed for the judgeship by Alexandria attorneys Terrence A. Sidley, Albert H. Grenadier and James Woolis.

Judges in Virginia are nominated in a caucus of the Democratic Pary, and then elected by the overwhelmingly Democratic legislature. The endorsement of the legislators from the area in which the judge will serve is considered critical to selection, and the support of the local bar association is also important. Republicans have attacked the current selection process, saying it excludes them and the public from a meaningful rule in the determination of who shall sit on Virginia's bench.

The selection process has also been criticized because of the relatively narrow pool from which judges are drawn.

In 1976, a Washington Post survey found that half of the 16 state circuit court judges in Northern Virginia were either law partners, former members, or relatives of members of the General Assembly that elected them to the bench.

The alexandria Bar Association meets Jan. 4 to endorse its candidate.

Thomson has been considered the leading contender for the vacancy because of his strong political ties in Richmond. His candidacy, however, came under fire this week from an informal coalition of lawyers, blacks and women, who believe Thomson's controversial views on civil rights and women's issues make him unfit for the bench.

This week, the NAACP announced its opposition to Thomson along with the American Civil Liberties Union and vowed to set up picket lines at the bar association's meeting.

Thomson said yesterday he "understood" the criticism and announced he would withdraw his name if the bar chose not to endorse him.

After the meeing, Thomson said, "I've been right about some things and wrong about other things. I've made mstakes."

Thomson also said the judgeship would enable him to complete his 30-year requirement for a pension under the government retirement plan. CAPTION: Picture, James M. Thomson: "If you go on the bench, you cannot advocate political beliefs." By John McDonnell-The Washington Post