Two days after he vowed to represent "all the people" in his race for governor of New York, Mayor Ed Koch has been embarrassed by a Playboy magazine interview in which he slams the suburbs, ridicules the rurals and even attacks the benign cow.

The suburbs: "A sterile environment," says Koch in the interview, which was conducted late last year before he decided to run for governor. Albany: "Small town life at its worst." Life in the country: "The country?" says Koch. "Rural America? This is a joke."

Koch, in a city hall press conference this morning as the story broke, was abashed, if not contrite. Just joking, he said, though he stands by his remarks that life outside the Apple is "sterile."

His commentary about rural people and their "gingham dresses" and "Sears and Roebuck suits," he said, was not a "put-down" but a way of defending his town. The mayor, a Democrat, said he hoped upstaters would appreciate his sense of humor. Upstate, it turned out some had.

"I had calls all this morning," said State Republican executive director Ed Lurie. "The county chairmen are all smiling today."

Koch has not, of course, been historically a diplomatic soul. He called Billy Carter a "wacko;" told reporters, when Prince Charles came to visit, that the prince was going bald, and when Pravda criticized him recently characterized them as "those red nuts."

Such is the outpouring of his mouth that it was collected into a book "The Wit and Wisdom of Mayor Koch."

Even so, a long lead-time can wreak havoc upon the politico. In December, when Koch sat down for 16 1/2 hours with Playboy interviewer Peter Manso, his ambitions, he said often, were only with the city of New York, and he was enjoying a public spat with City Council President Carol Bellamy.

("A horror show," he said, although a few days later she gave him a Dr. Seuss book and they made up.)

This week, when Koch announced his gubernatorial desires, he stressed that the city-dweller and the farmer could be friends, a position generally viewed with as much disbelief in North Tonowanda as it is in Manhattan.

"Not since the Great Depression have the interest of rural New York, urban New York and suburban New York had more in common," he said. He also said Bellamy, who will succeed him should he become governor, was well qualified.

In the April issue of Playboy, he takes a rather different tack. Bellamy, he calls "a pain in the a--," although the magazine notes this was when the two were feuding.

He says that "anyone who suggests that I run for governor is no friend of mine." Being governor, he said "requires living in Albany, which is small-town living at its worst."

But it is in a question on "the dirt, the crime and the inconvenience" of city life where the mayor delivers his strongest indictment of other forms of life.

"Have you ever lived in the suburbs? I haven't, but I've talked to people who have, and it's sterile, it's wasting your life. And people do not wish to waste their lives after they've seen New York," he says.

Later, as the interviewer says that "America is more than big cities and overcrowded suburbs," that for many there is the "more pastoral existence--life in the country," Koch is the consummate New York City chauvinist.

"The country? Rural America? That is a joke . . . rural America doesn't even exist anymore, not even the farms . . . let's leave out rural America, with the cows."

Pressed about the wasted time in the city because of poor services, he counters aggressively.

"As opposed to wasting time in a car? Or out in the country, wasting your time in a pickup truck? (Laughs) When you have to drive 20 miles to buy a gingham dress or (laughs louder) a Sears Roebuck suit? (Cracks up) This rural America thing--I'm telling you, it's a joke."

Today, Koch said he was attempting to be "jocular" and the interview might affect his campaign only "for a day or two." He did not retract any statements, but he did express regrets, of a sort.

Would the mayor buy up all copies of the magazine?

"If I could afford it, yes," said Koch.