Federal auditors yesterday accused Harvard University Medical School of mishandling several million dollars of federal research grants in the mid 1970s and ordered the school to refund $1.7 million.

Thomas O'Brien, Harvard's vice president for finances, said the school would contest the audit, which was conducted by investigators from the Health and Human Services Department. He said the dispute was over the school's accounting methods and, at most, Harvard owes $1,400.

Harvard charged $77.8 million of its expenditures during fiscal 1975-77 -- the three years that were audited -- to federal grants or contracts, or nearly 50 percent of the school's $164 million expenditures during that period.

The audit, which began in 1979, doesn't accuse the school of criminal wrongdoing. Instead, it says Harvard violated a number of federal regulations governing how educational grants can be spent.

Among other things, Edward A. Parigian, the HHS regional auditor who conducted the review, said Harvard had:

* Improperly shuffled $1.6 million from one federal project to another or to non-federal projects to cover cost overruns and to insure that no grant money went unspent.

* Charged an estimated $3 million to federal projects on an arbitrary basis, often without expense receipts or other documentation.

* Failed to keep adequate salary records, making it impossible for auditors to determine the validity of $26 million in salaries paid with federal grant funds.

"The university should control government funds in the same way that it controls its own," Parigian said. "What we see at Harvard and others as well, are indications that systems for accounting of federal funds are not the same as they would be if Harvard were spending its own money."

For example, Parigian said the audit showed a Harvard administrative assistant had approved salaries -- paid with federal grant funds -- for a three-month period prior to her own employment, making it impossible for her to have known if employes had worked the hours that they claimed.

O'Brien said the school was bound to make some errors in handling its grants because Harvard's grant system is decentralized and a single grant could have involved several departments. "In a single year, more than 300,000 pieces of paper -- which are transactions -- are required to charge our costs to federal grants," he said.

The system is much more accurate than the HHS audit reflects, O'Brien said. An audit by an independent accounting firm of Harvard's grant receipts in 1978 found less than $200,000 in questionable charges to the government, O'Brien said.

The audit is another salvo in a long battle between universities and the government over the way the schools account for federal grants. In 1979, the Office of Management and Budget demanded "effort reporting" from schools -- documentation of how teachers spend their time while receiving federal funds.

"If a professor is being paid to work fulltime on a grant program, he should not be teaching, too," an OMB spokesman explained.

More than 20 faculty senates passed resolutions opposing the regulations and this year the Reagan administration put through a new, relaxed rule.