President Reagan and District Mayor Marion Barry have a lot in common despite their sharp partisan differences. Both are consummate politicians, skilled, popular and affable, and it is becoming increasingly clear that there is another trait they share: If Reagan is the Teflon President on which nothing sticks, Barry has to be the No-Stick Mayor off whom numerous allegations fall.

So far, he has been one lucky politician. Aside from being very hard-working, the mayor also has a knack for surviving. Indeed, some people are wondering how he has managed to survive the hints of scandal that have touched his administration.

In the latest episode, the mayor was linked to the activities of convicted cocaine dealer Karen K. Johnson. Prosecutors tried to prove that Barry had lied when he told a grand jury he had not obtained cocaine from Johnson. But Johnson's release last week signaled an end to that investigation and the close of another chapter in the life of Marion Barry.

After talking with a cross section of District residents, I have to conclude that part of the mayor's ability to survive is based in the nature of the activities he is alleged to have engaged in.

Because many people look at politicians with a fair amount of cynicism anyway, they are not greatly surprised when politicians' personal lives are not those of model citizens. At the same time, however, people draw a line between the professional and private lives of a politician. If it had been charged and proven that Barry used his political power for personal enrichment -- a betrayal of the public's trust -- D.C. residents would have had a hard time forgiving him.

But that was not the case. Charges involving the mayor's personal life were made against him. Not only have they not been proven, but they did not matter to many residents when seen in the light of his administration's accomplishments.

Of course, what mistakes are permissible for a politician to make depend upon several factors: the mistake, his constituency and whether or not his sin is in conflict with political views he has expressed. Most D.C. residents do not believe that Barry is engaged in politics for his personal enrichment.

One longtime city resident, a Capitol Hill employe, put it this way: "I deal with politicians every day, and compared to the high level of corruption and nepotism you see in most local governments, the District is a much better run city than most, and what the mayor is accused of doing is lightweight."

The resident would agree with the mayor's statement last week that most of the residents of the District think he is honest in his political life.

According to the mayor, the origin of all his difficulty is his relationship with the media. Last summer, the mayor blamed U.S. Attorney Joseph E. diGenova for linking him to the drug activities of Johnson, saying that diGenova was trying to "lynch" him with press leaks. Last week, however, Barry pointed to the media, not diGenova, as being responsible for damaging his reputation.

"The media in their zeal and zest for sensational headlines," he said, "have attempted to try me, not by a jury of my peers, but rumor, innuendos, encouragement of leaks and violating secrets of the grand jury."

While there may be some truth to his statements, as a shrewd politician, Barry seems to do whatever is convenient to remain alive politically. He seems to be trying to make peace with the prosecutor because he may still be vulnerable in other areas. Charges have been leveled against his former close aide, Ivanhoe Donaldson, who is being investigated by a grand jury about Donaldson's handling of $30,000 in checks he issued while working for the city. So shooting the messenger -- the press -- instead of the person sending the message -- diGenova -- may be Barry's way of buying insurance for the future.

But there is a danger he should consider: An excess of allegations can demoralize any administration. In such an atmosphere, political corruption could indeed take hold.