Trying to maintain momentum behind the largest peacetime tax increase in history, Sen. Robert J. Dole (R-Kan.), chairman of the Finance Committee, yesterday altered the legislation to relieve some of the prospective burden on people with high medical bills and those with little taxable income.

Originally, as reported by the Finance Committee, the bill would have raised from 3 to 10 percent the amount of taxable income a person could spend on medical costs before the expenses would become deductible. Dole lowered this to 7 percent.

To make up for the lost revenues when the floor on medical deductions is raised from 3 to 7 percent, instead of to 10 percent, Dole's changes would lower the amount of medical insurance premiums that can be deducted. The maximum would be reduced from $150 to $100. He also proposed accelerating some corporate income tax payments.

In addition, single taxpayers who in the previous year paid less than $600 in federal income tax would be exempt from from the new withholding on interest and dividends. So would couples paying less than $1,000 in taxes.

Dole's alterations were approved yesterday by the Senate as it took up the legislation, which would raise taxes by $21 billion in 1983 and cut domestic social programs by $4.2 billion. Dole and Sen. Howard H. Baker Jr. (R-Tenn.), the majority leader, were both optimistic over the prospects for the legislation.

President Reagan gave formal backing to the bill in a letter to Baker sent over the weekend. "I wish to emphasize my personal support for the bill produced by the Senate Finance Committee," Reagan said.

In the House, however, where the Ways and Means Committee is to take up tax increases later this week, many of the president's conservative GOP allies are balking at the prospect of an election-year tax boost.

An aide to Baker said the toughest hurdle facing the legislation is a proposal to require 10 percent withholding on dividend and interest income. It is this provision that would be waived for low income taxpayers. Similar measures have been killed by overwhelming margins in the past, largely because of pressure from the banking and savings and loan lobbies.

This year, however, prospects for the withholding proposal on the Senate floor look significantly better, in large part because Dole has threatened to proposed a tough minimum corporate tax--which is opposed more than withholding by the banking industry--in the event withholding is rejected.

A section severely restricting special tax benefits to corporations that set up subsidiaries in United States possessions has Puerto Rican officials in an uproar. They contend that the island, which has already been hit by cutbacks in the food stamp program and is suffering a 23 percent unemployment rate, faces an exodus of corporate employers if the provision is enacted.

Congressional aides counter, however, that the tax subsidy is costing the Treasury an average of $12,667 for every job created. The jobs pay an average of $10,667. In the case of pharmaceutical companies, which are the major beneficiaries, the average subsidy going to the companies for each job is $43,261 while the average pay for the pharmaceutical jobs created is $13,618.

Puerto Rican officials contend, however, that enactment without some other form of compensation will mean the loss of at least $15,000 jobs. Other major provisions of the bill include:

* Severe restrictions on legislation passed last year that allowed corporations to buy and sell tax breaks.

* A strengthened minimum tax for rich individuals who pay little or no tax currently because they take extensive advantage of existing credits and deductions.

* The closing of a number of provisions that allowed some life insurance companies and many long term contractors, particularly those in the defense and aerospace industries, to postpone payment of most federal taxes.

* Cutbacks in the business tax breaks enacted last year.