Sen. Alan Cranston, seeking support of the nation's gay and lesbian communities in his bid for next year's Democratic presidential nomination, pledged at a gathering here last night to fight to end "all forms of discrimination in our society."

Cranston, addressing the third annual dinner of the Washington-based Gertrude Stein Democratic Club--one of the largest and most politically active gay organizations in the country--said he was the only candidate in the race "with a clearcut and positive record on the issue of gay and lesbian rights."

The California Democrat, one of six current contenders for the 1984 nomination, told a crowd of about 400 persons at the Hyatt Regency Hotel that "social justice" would be a major theme of his campaign and presidency.

Cranston, who was warmly applauded during his remarks, also announced that he had reintroduced a measure in the Senate that would overturn an immigration law that bars homosexual foreign nationals from entering the United States. The measure has failed in past sessions.

Cranston told the audience that he would support additional federal funding for research into the causes of Acquired Immune Deficiency Syndrome (AIDS), an often fatal disease primarily affecting gay males that has reached near-epidemic proportions in the U.S.

D.C. City Council member John A. Wilson, one of dozens of city officials who attended the banquet, announced earlier yesterday that he has introduced a bill in the council that would fund a $50,000 campaign to educate District residents about AIDS.

Cranston also used the occasion to stress yet again what he has called the number one concern of his campaign--an end to the nuclear arms race "before it ends us."

He also repeated his support for full employment, a theme he used earlier in the day in a speech here before the Building and Construction Trades Department of the AFL-CIO.

On the nuclear freeze issue, Cranston defended his stance before the leaders of the traditionally conservative unions by telling them: "I'm not a pacifist. I know the necessities of defense. I have no illusions about the Soviets. I know that they are aggressive . . . but they are human beings concerned about the fate of their children."