"If you open any door in any office building in Washington or any big city, you are going to find somebody thinking about who or what they will shoot or blow up," says Richard Rees, a Washington-area psychologist who consults for the federal government and for high-tech companies.

"We all have aggressive and hostile fantasies about those we work with. (These fantasies) may go so far as leaving someone dead or blowing up somebody. (The fantasy) is a reasonably healthy way of discharging those feelings," says Alvin Green, chief psychiatric social worker in charge of out-patient programs at the Menninger Foundation in Topeka, Kan.

"Everyone has these fantasies. It doesn't matter how high up you go, even psychiatrists and doctors," says Dr. David V. Forrest, an assistant professor of psychiatry at Columbia University. "A doctor might have a chairman at the hospital that he wants to bump off."

Fantasies about wringing the boss's neck or grenading the typing pool are not only common but useful, psychiatrists say. In an increasingly desk-bound culture, where corporate and bureaucratic restraints offer few outlets for blowing off psychic steam, psychiatrists say aggressive fantasies help "ventilate" aggression.

"If we make these fantasies conscious, maybe joke about them, it's better than bottling them up completely," says Forrest.

The danger, of course, is that violent fantasies in the workplace can become obsessions that lead to actual violence. Psychiatrists say they don't understand how this happens.

There is no pat explanation for why Edward Thomas Mann, a disgruntled former IBM employe, rammed his Lincoln Continental into his old office building in Bethesda a week ago Friday and allegedly went on a shooting spree, killing three people and injuring six. Nor is there any theory that will explain why a fired city worker from LaPorte, Ind., last week allegedly wounded the town's mayor and killed the mayor's wife.

Fantasies are as much a part of everyday life as breathing, according to psychologists who study daydreams. For most people, whose lives are filled with standard imaginings about sex, fame, wealth, food and vacations, fantasies about violence at the office are a normal but infrequent feature of daydream programming, according to Jerome L. Singer, a professor of psychology at Yale and one of the world's experts on daydreams.

The danger of these rub-out-the-boss fantasies lies not in their vividness, but in their frequency and in the chance that they can become "the primary dominant fantasy," Singer says.

Notebooks of assassins, Singer says, show violent fantasies dominating the inner lives of would-be murderers. The dairy of Sirhan Sirhan describes again and again the scene in which he ultimately shot and killed Robert Kennedy. Arthur Bremer, who shot George Wallace, kept a similar notebook. The letters of John W. Hinckley Jr. show a troubled man lost in the fantasy that shooting President Reagan would somehow make him a hero in the eyes of actress Jodie Foster.

"For any particular person, we don't know where to locate the transition from a normal to an obsessive fantasy," Singer says.

Violent fantasies can become dangerous when people isolate themselves and brood over the fantasy until it becomes a plan for action, says Judson Stone, a social worker and executive director of a mental health center in Chicago.

"The people who tend to act out their fantasies are loners," says Stone, who counsels unemployed white-collar workers. "You need friends to talk out these fantasies. If you get laid off, for God's sake don't give up your friends. When I think of the shooting or beatings that I've seen, it is people who are initially gregarious and friendly and then they withdrew. There was no check on their fantasies."

In the past year Edward Mann withdrew from his neighbors in suburban Prince George's County, his friends say. For years at Halloween, he had dressed up in a Frankenstein costume to amuse local children. This past year, however, he wore no costume and posted a sign on his door that said: "No Candy."

Fantasy research on thousands of people over the past 20 years has found that normal daydreams come in three major patterns. First, there are fleeting fearful fantasies. Is my fly unzipped? Is my slip showing? Is there mustard in my mustache? Do I have cancer? People preoccupied with these daydreams, Singer says, usually have short attention spans.

Second, there are guilty and hostile dreams. Machine-gunning one's secretary falls into this category, along with worried fantasies about failure to meet the expectations of bosses or family. Studies have shown that people dominated by these daydreams are likely to try to escape them by heavy drinking or watching a lot of television.

Third, there are vivid, visual and pleasant fantasies about success -- getting a raise, flying to the moon, winning the Nobel Prize. "The evidence suggests," says Singer, "that successful people have more of these positive, constructive fantasies."

The patterns of anyone's fantasy, of course, are closely linked to what's going on in their lives. A man with a degrading, frustrating job -- or no job at all -- is far more likely to daydream about choking his boss than someone with a good job.

While occasional aggressive fantasies can be cathartic, recent research indicates that a daydreamer risks his own health if he dwells on violence.

A Yale study published this spring shows that joggers who dwell on hostile and aggressive fantasies will not, Singer says, "get the benefits of blood pressure reduction that runners experience when their fantasies are pleasant.

"Having a lot of aggressive fantasies is not good for you. It is an uncomfortable life."

Psychiatrists say that anyone with constant daydreams about violence -- in the office or anywhere -- probably needs professional help. But they add that an occasional fleeting fantasy about office mayhem shouldn't cause alarm.

Douglas LaBier, a Washington psychologist who treats many mid-level bureaucrats, has heard the shoot-up-the-office fantasy so often he's come to believe it's endemic to people who worry about their careers.

"These murderous fantasies are without blood or gore. (In their fantasy) they just go in the office and shoot it up," says LaBier, who is a senior fellow at the Project on Technology, Work and Character and a faculty member at the Washington School of Psychiatry.

"For some reason, people seem to find pleasure in that. It doesn't mean you're neurotic."