Lewis E. Lehrman, the overwhelming favorite in Thursday's Republican gubernatorial primary, attacked his lunch of two McDonald's French fry bags with both fists, as he attacks in the same style a man who is not yet his opponent.

"Mayor Koch is a witty, Borsch-Belt comedian," he says. "That's all . . . no ideas."

Lest there be doubt, he adds: "Make no mistake -- we're running against Koch right now."

Over at Gracie Mansion, Mayor Edward Koch, responds in kind, even though his nomination in the Democratic gubernatorial primary is suddenly far from assured.

He dabbles with iced tea and cookies and forgoes his Democratic opponent, Lt. Gov. Mario Cuomo, to take a swipe at another fellow who came to him for a job in the city government just 19 months ago.

"His name was Lew Lehrman," says the mayor, chuckling at the memory. So it is that Koch and Lehrman are girding for a race against each other, a preparation that may well be premature because Cuomo, a liberal, appears to have made significant late gains against the more conservative mayor.

Still, Koch confidently forecasts his own primary victory and delights in telling about the job interview at City Hall for the man he believes will be his next opponent.

"He sat down and I said, 'Lew, if I were to designate you as deputy mayor for economic development, what is the first thing you would do?' And he said, 'I would immediately eliminate the personal income tax.'

"I said, 'How much do you think that brings in, Lew?' He said, '$50 million.' At that point . . . a Koch aide said, 'It's $880 million.' . . . . He sat back in his chair and said, 'Gee, well, I guess it will take a little longer than I thought.'

" 'Well now, Lew, what's the second thing you would do?' He said, 'I would abolish all services other than essential services . . . .'

"So I said, 'Well, that's interesting, Lew, what are the essential services? " He said, 'Cops, firemen, sanitation and that's it.'

"I leaned forward in my chair and I said, 'Lew, no education?' A long pause, and he said, 'Okay, education too.' "

The mayor begins to laugh.

Asked about Koch's recitation, Lehrman erupts: "Nonsense! Baloney!"

According to Lehrman, there was indeed a meeting about a job, but it was initiated by the mayor.

"Mayor Koch was courting president -elect Ronald Reagan at the time, he wanted to curry favor with the new White House," says Lehrman, sounding much the same line as Cuomo. Lehrman says he did talk to Koch about eliminating the city's personal income tax, "but over 12 years, 12 years! . . . the mayor is a very silly man."

For Lehrman, a 44-year-old Rite Aid Drug Store multimillionaire, winning the Republican nomination on Thursday appears to be a sure thing. He has spent about $7.2 million so far, nearly $4 million from his own pocket, much of it on a television ad blitz early this year. It got him enough name recognition to capture his party's convention from the once-powerful but now moribund Republican machine, which has not worked well since the Rockefeller era.

The organization candidate, former U.S. attorney and state assemblyman Paul Curran, trails by such wide margins in the polls -- by about 50 points in some -- that most of the small group of party leaders who still nominally support him have urged Curran privately to drop out. Only one, Nassau County's Joseph Margiotta, has raised funds for Curran and that was a sort of last hurrah by the county leader, who is awaiting sentencing on his conviction for fraud and extortion.

Lehrman, a Yale graduate, is a devout disciple of supply-side economics and wrote an early memo for the Reagan presidential transition team on the subject. He promises to cut personal income tax rates, then business tax rates, to help make the state competitive and to expand capital formation and create jobs.

He also has named two programs whose budgets he would cut: mental health and the state welfare home relief program.

Lehrman also has the Conservative Party nomination and will appear on the Nov. 2 ballot on yet another line, an Independent nomination he secured through a petition drive.

As assured as his victory Thursday appears to be, there is even less interest in the GOP Senate primary in which former U.S. attorney Whitney North Seymour, former state banking superintendent Muriel Siebert and Assemblywoman Florence Sullivan are competing for the dubious honor of taking on Democratic incumbent Sen. Daniel Patrick Moynihan.

Recent polls show more than half of the Republican voters still are undecided.