Former Republican presidential candidate Bob Dole endorsed Ronald Reagan for president tonight, saying that he had a "hammerlock" on the Republican nomination and was the GOP candidate with the best chance of defeating President Carter this fall.

Quoting from Carter's slogan of 1976, Dole said to the cheers of a partisan audience here: "Why not the best? Ronald Reagan is the best, as some of us know firsthand."

Dole is the second former GOP candidate to come out for Reagan. John B. Connally endorsed the ex-California governor in Texas last week with a prediction that Reagan would attract enough Democratic and independent votes to win the presidency.

Unlike Connally's endorsement Dole's announcement came as a surprise to Reagan and his aides. The Kansas senator told Reagan about it just a few minutes beforehand, at a reception for GOP volunteers working for Reagan in Tuesday's Kansas primary. Reagan is a top heavy favorite to defeat George Bush and John Anderson in that primary election.

In making his endorsement, Dole could not resist indulging in the sense of humor that won him both fame and criticism on the campaign trail.

"I know from my own conversations with Gov. Reagan that he will bring to agricultural America a combination goal of faith, hope and parity," Dole said to the laughter of his pro-Reagan audience. When the laughter had subsided he added the words, "in the market place."

Dole's quip was a reference to a verbal stumble by Reagan a week ago, when he left a Kansas audience with the impression that he didn't know what "parity" was.