Even at the leading American teaching hospitals, physicians and nurses make a surprising number of serious errors in prescribing drugs, according to a study by the Harvard School of Public Health reported in today's Journal of the American Medical Association. During the last six months of 1993, the Harvard researchers reported, 334 drug errors were made at Massachusetts General Hospital and Brigham and Women's, 39 percent as serious as ordering a drug to which a patient was allergic or prescribing the wrong dosage. Other mistakes were made by nurses or as a result of secretarial errors in transcribing a doctor's orders. While the researchers said that most errors were caught in time, and no patients died as a result, 70 people suffered unnecessary complications, 14 life-threatening and 30 others serious. Dr. Lucian Leape of the Harvard team argues that such measures as installing bar-code machines at patients' bedsides to check drug sensitivities could eliminate the errors, many of which could kill patients if undetected in time.