WASHINGTON THE nation's major drug companies, some stung by large liability costs, have been dropping out of vaccine production for years and the trend is continuing, raising fears that future supplies may be jeopardized, important research will be neglected and the costs of vaccines may skyrocket.

The latest dropout was Wyeth Laboratories, which announced June 13 that it had ceased production of a vaccine used to immunize children against whooping cough after more than 30 years of producing it. The company cited ''dramatic increases in the cost of participating in this market,'' chiefly due to liability insurance and the costs of litigation. The whooping cough vaccine has the most serious side effects of any of the vaccines now adminstered to virtually all children in the country under state or Federal laws.

The Wyeth defection continued a trend that has been under way for the past decade or two, according to Paul D. Parkman, deputy director of the center for drugs and biologics at the Food and Drug Administration. During the 1960's, Dr. Parkman said, there were eight manufacturers of the combined vaccine that is used to immunize children against diphtheria, whooping cough, and tetanus; now, after Wyeth's withdrawal, there are two, Lederle Laboratories of Wayne, N.J., and Connaught Laboratories Inc. of Swiftwater, Pa. Four other vaccines that are administered to virtually all children are now produced by a single domestic manufacturer, according to Dr. Parkman. The live-virus measles vaccine, made by six companies in the 1960's, and the German measles vaccine, made by three companies then, are now manufactured only by Merck Sharpe & Dohme of West Point, Pa. So is the mumps vaccine, which Merck Sharpe has produced alone for two decades.

The live-virus polio vaccine, which had three makers in the 1960's, is now made only by Lederle Laboratories. And the influenza vaccines, administered on a voluntary basis to millions of adults and children, are produced by only three companies, down from seven in the 1960's.

High Costs of Liability

The reasons for the shrinkage are complex and vary from company to company, according to industry sources and Government officials. Some companies concluded that the vaccine market was too small and profit margins too low. Others dropped out because competitors developed superior products. Still others were squeezed out because the very success of vaccinations in reducing disease also reduced the demand for some vaccines.

But increasingly manufacturers are blaming the high cost of protecting themselves against liabiity claims by the small number of people who are inevitably harmed by severe adverse reactions to the vaccines. Even if a vaccine is produced with the utmost care in accord with the most stringent specifications, it is virtually certain to cause harm to a tiny fraction of those who use it, or sometimes to those who come into close contact with those who receive it. Some victims who suffer debilitating physical damage, or even death, receive little compensation for it. They are the unfortunate victims of programs designed to protect the public health. But other victims are successful in winning large liability awards that can eat into the profits of the manufacturers, either through the awards themselves or through legal fees and higher insurance costs.

A report submitted to a Congressional committee this year cited 11 recent court awards or settlements in which victims won between $150,000 and $5.5 million. Sometimes the manufacturers end up paying substantial awards even though they made their vaccines perfectly.

Federal Intervention Sought

The steady withdrawal of vaccine manufacturers has caused alarm among professional organizations and in Congress. The American Medical Association at its annual meeting last week approved a report calling for the Federal Government to assume responsibility for compensating the victims of mandatory childhood immunization programs, relieving the manufacturers of liability risk unless they are negligent.

''Of all of the armaments of medicine, vaccines offer the greatest potential benefit to the greatest number of persons,'' the A.M.A. report said. ''They also, however, continue to have statistically predictable incidence of very serious injury for a very few persons.''

As examples, the report estimated that one in every 312,500 doses of whooping cough vaccine, and one in every one million doses of measles vaccine would cause brain damage, and that one in every 3.2 million doses of polio vaccine would cause paralysis, mostly in unvaccinated adults who came into contact with vaccinated children.

The Institute of Medicine of the National Academy of Sciences is conducting a study of the factors that are driving companies out of vaccine production and interfering with the development of new vaccines. Roy Widdus, the staff officer for the study, said it was motivated in large part by indications that ''the industry which was responsible for producing vaccines was not healthy'' and that ''people were dropping out'' at the very time that advances in biotechnology showed ''an enormous potential for developing new vaccines.''

A Crisis 'Waiting to Happen'Thus far the shrinking vaccine capability has caused no major supply problems. ''We don't yet have a crisis, but it may be that a crisis is waiting to happen,'' said Kenneth Bart, a vaccine authority at the Centers for Disease Control in Atlanta, a Federal agency that purchases vaccines for many of the state childhood immunization programs.

The chief worry is that in cases where there is only a single manufacturer of a vaccine, the supply could be disrupted by an unexpected manufacturing problem, a bad batch of vaccine, a strike by employees or a decision by the last manufacturer to abandon the market. Vaccines generally are technologically much harder to produce than are drugs, which makes problems more likely and emergency production by new companies more difficult.

Another concern is that prices will rise as the number of competing companies dwindles and liability costs continue upward. The price of the combined diphtheria, whooping cough and tetanus vaccine has soared from five cents a dose five years ago to between 68 cents and $2.33 a dose under recent state contracts, even with three manufacturers competing.

The final worry is that research aimed at designing new vaccines will diminish as the number of companies producing vaccines grows smaller.

The Federal Government is trying to head off supply problems by building a stockpile, paid for by the Government and stored at the manufacturing sites. Dr. Bart says there is a three-month supply of both polio vaccine and the combined measles- mumps-German measles vaccine. The goal is a six-month supply. There is also a proposal to start stockpiling the combined vaccine for diphtheria, whooping cough and tetanus.

Meanwhile, Senator Paula Hawkins, Republican of Florida, and Representative Henry A. Waxman, Democrat of California, have introduced legislation that would establish a Federal mechanism for compensating victims injured by vaccines. The bills, which reflect the views of the American Academy of Pediatrics and parents of vaccine victims, are primarily intended to insure that the victims receive just compensation. They are opposed by vaccine manufacturers because they do not rely exclusively on Federal compensation but allow litigation as well.