President Reagan yesterday signed a bill that will permit health insurance firms to give refunds ranging from $17 to almost $400 to more than 2 million government workers and retirees, including about 350,000 in the Washington-Baltimore area.

The refunds -- on 1985 health insurance premiums -- were first proposed last spring by Blue Cross-Blue Shield, the nation's largest health insurance company for federal subscribers. The firm said its financial reserves had built up because employes and retirees were not using their insurance as much as in previous years and were paying a larger share of their own medical bills.

Most of the refunds, which amount to more than $1 billion, will go to the government, which pays about 60 percent of the average employe's premium. The federal health insurance program is the nation's largest single plan. It helps pay medical, dental and hospital bills for more than half the people in the District of Columbia.

After Blue Cross-Blue Shield proposed the refunds -- the first ever in the federal health program -- six other health plans announced that they would return portions of 1985 premiums. The Reagan administraton initially endorsed the refunds, but the Justice Department said that while checks could be issued to current government workers, Congress would have to pass special legislation before the nearly 1 million eligible retirees could get them. The insurance companies said they would delay making refunds until all eligible policyholders could get them.

Congress passed a refund bill late in December. But the president vetoed it because the House added some features that the administration said would raise costs. Congress passed a revised bill and sent it to the White House Feb. 20.

Health insurance companies offering the refunds will soon begin to mail letters of notification advising policyholders of the amounts due. The size of each refund depends on which plan the recipient was enrolled in last year and whether it provided single or family coverage.

Plans offering refunds to Washington area subscribers are Blue Cross-Blue Shield, Aetna, American Federation of Government Employes, Government Employes Hospital Association, Government Employes Benefit Association, Foreign Service plan and National Association of Letter Carriers.