The election-year clout of veterans was demonstrated yesterday as the House and Senate, by almost unanimous votes, overrode President Carter's veto of a Veterans Administration physicians' pay raise bill.

The vote was 401 to 5 in the House and 84 to 0 in the Senate. Sponsors of the legislation in both bodies said the president was just plain wrong in his analysis of the bill.

Carter vetoed the bill, saying it would cost $80 million a year and would give some VA physicians 38 percent bonuses, giving them salaries of $76,200 a year -- 30 percent more than the top pay for military physicians. But Sen. Alan Cranston (D-Calif.), chairman of the Senate Veterans Committee, said the cost would be closer to $40 million. The biggest pay increase would be 23 percent and military doctors would still be paid more, he said.

Rep. Ray Roberts (D-Tex.), House Veterans Committee chairman, said more than 400 VA hospital beds have been closed because of a shortage of doctors. Roberts said he was "puzzled" by the veto. Rep. Margaret Heckler (R-Mass.) said the veto "confounds my imagination" in view of a shortage of more than 700 VA doctors. The Paralyzed Veterans of America hailed the action as permitting the VA to compete for the best qualified medical personnel and to fill medical vacancies.