With a quip and a smile, Republican Rep. Paul N. (Pete) McCloskey today abandoned his House colleague John B. Anderson in favor of an old foe, Ronald Reagan.

Until this week McCloskey had described independent presidental candidate Anderson, who once came to McCloskey's aid when Nixon Republicans were trying to purge the Californian from the GOP, as "the most qualified candidate."

Today, McCloskey said he is "fully supporting" Reagan because it is a two-man race and because President Carter is more likely than Reagan to lead the nation into war.

In McCloskey's suburban San Francisco District, according to a recent poll, the two-man race is between Anderson and Reagan. McCloskey said the survey gave each 38 percent, compared to 12 percent apiece for Carter and "no preference."

Amid the incongrous blare of a mariachi band McCloskey today placed a "Reagan-Bush" bumper sticker on the back of his battered, 1971 red Volkswagen, which had just been searched by the Secret Service for bombs. He then shook Reagan's hand and gave him a mock salute.

"I just ended 10 years of hostility," McCloskey said. "The governor [Reagan] said 10 years ago that I ought to represent only the San Andreas earthquake fault, and I said he should raise his tax-free cattle there. But I think four more years of Jimmy Carter would be a disaster. . . . because I think the consistency of a Reagan foreign policy would be far less dangerous than the inconsistency of Carter foreign policy.

"I've seen Carter change position on the neutron bomb, Pakistan, on nuclear power, the export of nuclear material [and] on the Israeli question, and these zigzags on foreign policy, in my judgment, are much more dangerous to preserving world peace than the consistency of Reagan."

McCloskey is far closer to Anderson on most issues than he is the Reagan.

The Californian supports the Equal Rights Amendment, the draft and "freedom of choice" on abortion, all of which Reagan opposes. And McCloskey, a decorated Marine combat officer in the Korean conflict, called the Vietnam war "immoral," while Reagan has judged it "a noble cause."

In 1972, McCloskey opposed Richard Nixon for the GOP presidential nomination because of Nixon's Vietnam policies. MCcloskey received just under 20 percent of the vote in the New Hampshire primary and dropped out of the race.

Reagan subsequently lent moral support to the nearly successful efforts of California's conservative GOP establishment to defeat McCloskey in the 1972 Republican primary. At the same time, Anderson, then the House minority caucus leader, was defending McCloskey from House Republicans who wanted him ejected from the Republican Party.

But McCloskey said today that Reagan had earned the support of all Republicans.

"John Anderson is a good man an inteesting man, but he didn't win a single Republican primary," McCloskey said. "Our system is a two-party system, and it ought to be between the candidates who win the two primaries."

Reagan campaigned later today in the Northwest, which is considered more in his corner than is the rest of the western region. He spoke this afternoon at a suburban Seattle rally and then flew to Portland, where he is to campaign Friday.

Republican National chairman Bill Brock said earlier this week that Reagan is ahead in both Washington and Oregan but added, "we'll have to campaign in these states to hold them."