Amidst the cool fog that makes this city a refuge from the inland heat, local politicians are winding up a strange campaign that evokes memories of the Red-hunting days of the 1950s and the radical militancy of the 1960s.

Ostensibly, San Franciscans will vote Aug. 2 on two amendments to the city charter that would change the way some public officials are elected. Actually, one of the ballot measures is a thinly disguished recall attempt that would force three controversial officials - Mayor George Moscone, Sheriff Richard D. Hongisto and District Attorney Joseph Freitas - to face re-election this December in the middle of their present terms.

Both sides agree that theoutcomme of the "recall" measure, known as Proposition B, is likely to determine whether San Francisco continues on a course that its present leaeders regard as enlightened and impressive and that Proposition B advocates see as dangerously permissive and radical.

"San Francisco is at the crossroads right now," says Supervisor John Barbagelata, leader of the Proposition B forces. "What I am trying to do, by majority vote and before it's too late, is to give this this city back to the people and take it away from the radicals and the political machine.."

Barbagelata, who freely calls himself "a reactionary," lost narrowly to Moscone in the 1975 mayoralty election. He has been the target of unsolved bombing and shooting attempts and is under police guard. Barbagelata blames many of his troubles on Hongisto, who he says "inspired" radical elements by overly kind treatment of them.

"The sheriff is a very dangerous man, an extremist," said Barbagelata, 58, a soft-spoken real estate broker. "I can't say these things on radio or TV because you sound like a nut unless you can prove it."

Barbagelata's proof is that Hongisto has appeared on the the same platform with radical politician Tom Hayden, has gone to Cuba and has spoken to a 1976 conference in Austin, Tex., on alternative state and local government policies.

But his most persistent complaint concerns Hongisto's treatment of prisoners at the county jail, where the sheriff has improved diet and medical treatment and established an elaborate rehabilitation and instruction program that includes discussions of economic and political issues. From Barbaagelata's point of view, Hongisto has opened the jail to "white Panthers, black Panthers and all kinds of revolutionaries."

Hongisto, a self-described liberal who campaigned for homosexual rights in Dade County, Florida, makes no apologies. He was elected in 1971 after promising to clean up a jail in which prisoners had died or been maltreated, and even his critics concede that he has kept his promises.

"When people are sentenced to jail they're not sentenced to contract disease or to eat bad food or to be raped or to be assaulted by racist guards," says Hongisto. Earlier this year he voluntarily spent five days in a suburban jail and pronounced it better than his own.

Don Bradley, a veteran California campaign manager who is running the campaign against Proposition B, says that polls show that Hongisto is the most popular of the three city officials and that Moscone's job rating is relatively low.

"They made a mistakeke in including the sheriff," says Bradley. "If they'd have gone after George alone, they'd have given him fits."

One of the reasons for Hongisto's popularity is that he has no responsibility for the trouble-ridden city police force or the crime rate. The blame for city crime is given to Moscone or his appointeed police chief, Charles Gain.

The sheriff has strong support from the city's influential homosexual community, and Hongisto says that one of his homosexual deputies has helpeeeed to register voters in gay bars after hours.

"If he wantnts to help his local sheriff this way, who am I to say no," adds Hongisto with a smile.

The homosexuals are the militants of thiss campaign, playing the role taken by student militants in the 1960s.

"We had a lot at stake in putting this administration into office and we have a lot at stake in keeping it there," says David Goodstein, publisher of a homosexual newspaper, The Advocate.

Estimates on the number of homosexuals in San Franciscco vary more widely, said Bradley, than the "the numbers of Chiang Kai-shek's army." Honkisto accepts the figure of 15 per cent.

For the first time in his political career Moscone has the support of the Chamber of Commerce, which fears that a mid-term election would give the appearance of civic instability and discourage outside investors. Proposition B is also opposed by organized labor.

Moscone has been called the most progressive mayor in the nation. He also has been called the "worst mayor in the West," which was the title of a critical piece about his administration in the magazine New West. Others say that Moscone, who took officee facing a rising crime rate and a municipal strike, has simply been one of the unluckiest mayors around.

The pools taken for Bradley, and random conversations with San Franciscans, show that Moscone is contrasted unfavorably with his predecessor, the highly visible and frequently bombastic Joseph Alioto.

Moscone, 47, a lawyer, came into office after nine years in Sacramento as a state senator, and he was determined to overcome a reputation as a playboy and to demonstrate that he could make the difficult transition from legislator to administrator. In the process, he spent so much time in his office that he became almost invisible to many San Franciscans.

"The office of mayor is big stuff to the people of San Francisco," says Moscone. "You're supposed to be out on the firing line. You're supposed to shake your finger at wrongdoing and embrace people when they're doing right. Proposition B has given me a chance to be highlyyly visible and tough, and I've found that it works."

When he took office Moscone trieed quiet conciliation with dissenting supervisors and he says, "They beat the crap out of me."

Last month, with his new vision of the mayoralty in mind. Moscone went on television to denounce the attempts of supeervisors to hold up federal funds for 4,000 jobs as the work of "small, cheap vindictive people who had betrayed the public trust."

Moscone was uncomfortable with language that he regarded as irresponsible. But it did work. The supervisors voted unanimouslly to release the funds.

So, proposition B couldd turn out to be the best thing that ever happened to George Moscone. He believes that a big victory in August would establish him as a strong mayor and give him the opportunity to revamp the city's antiquated budget procedures without obstruction from the Board of Supervisors.

Moscone, who has received contributions from a number of the city's prominent businessmen, is expected to raise $100,000 and outspend the Proposition B campaign 4 to 1.

Both sides predict victory, but there is a general belief among politicans that Proposition B is likely to lose.

Though Moscone is a Democrat and Barbagelata is a Republican, the mayoral election is nonpartisan and no party designations appear on the ballot.

District Attorney Freitas, a liberal Democrat like Moscone and Hongisto, has played virtually no role in the campaign, and his performance has been a minor issue.

No one has a clear idea of what will happen to the other ballot measure, Proposition A, which would wipe out the district voting system approved by the voters at the last election and restore citywide voting for the 11 supervisors.

Citywide voting was a turn-of-the-century revision put in to curb San Francisco's often-corrupt ward politics of the last century. Supporters of Proposition A say that ward politics will return with a vengeance if district voting is allowed to stand.

A number of minority leaders believe that district voting also has potential for increasing minority representation on the board, but the only present black supervisor.Terry Francois, opposes the district system.

Organized labor and various community organizations, believing that they will have more influence under the district system, are opposing Proposition A as well as Proposition B.