Under threat of a third White House veto in a week, the Senate yesterday rewrote a supplemental appropriations bill to satisfy President Reagan's wishes, but the bill's reception in the vacationing House was left in doubt.

By a voice vote the Senate complied with the latest White House demands and approved the hastily contrived $5.2 billion compromise after Office of Management and Budget Director David A. Stockman told Senate leaders that he could not recommend that the president sign an earlier House-passed version.

Democratic leaders were angered by the president's latest threat, and it was unclear last night whether Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.) would summon House members back to approve the new compromise.

"I think the instinct here is to insist on our position and send it back," one O'Neill aide said, but he added that House leaders would be polled overnight at their vacation spots.

If there is no immediate House action several government agencies would have to furlough some federal employes temporarily because of a shortage of funds that the supplemental appropriation is meant to provide. The House may not consider it until it returns on July 12. The estimates of those who would be furloughed run as high as 9,000.

Although the money differences were not great, Senate Democrats reacted with hostility to the latest White House command to trim spending a bit more when it had appeared earlier that Reagan would accept a measure passed by the House just before it recessed last week.

Some Democrats expressed dismay at the prospects of knuckling under to another presidential demand.

Senate Republicans reluctantly went along with the latest presidential edict. Appropriations Committee Chairman Mark O. Hatfield (R-Ore.) said he learned early yesterday from Stockman that "to my amazement" Stockman would not recommend a presidential signature of the House-passed version.

"I don't believe the United States Congress should be rolled over . . . for any president," Hatfield told the Senate. "We are a co-equal branch of the government." He said the third version does not contain all that the president wants, and added, "If we change the overall total figures we are not going to get a signature."

Last week the president vetoed two supplemental bills because he said they spent too much money, principally in multibillion-dollar aid to the housing market. That housing money was stripped from the third version passed by the House, leading to expectations that Reagan would sign the measure.

But Stockman yesterday told Senate leaders that the latest House version was faulty on several points, touching off a day-long scramble for an acceptable compromise that Stockman finally said he could recommend to the president.

The House measure calls for spending $4.5 billion, but only until July 20, when a new version would have been taken up. Stockman told Republican senators that Reagan objected to its addition of about $350 million he did not want and also insisted on a bill that would run until Sept. 30, the end of the fiscal year. Stockman also called for inclusion of some items the president wanted but which the House had ignored.

The version passed by the Senate yesterday includes $5.2 billion, and would run until Sept. 30.

The major change in the Hatfield compromise strips $1.6 billion in rental-housing subsidies and $150 million in funds for the Government National Mortgage Association from the House version. It also restores 15 items the president had wanted but the House rejected.