All the orthodox wisdom is that it can't happen, that Chicago is a Democratic town, the home of the most awesome of the old big-city machines. Even the Chicago Cubs win more often than Republicans here.

The city hasn't had a GOP mayor since William Hale (Big Bill) Thompson left office in 1931, or a single Republican on the 50-member City Council since 1977. But politicians here contend that Bernard Epton, all but unknown until a few weeks ago, may stand a better chance of being elected mayor than any other Republican in the past half century.

In a city long dominated by Irish mayors, Epton is the most unlikely of political figures. A Jewish Hyde Park liberal held suspect by party regulars, he is an urbane and soft-spoken attorney with a dry wit, sad eyes, a bald head and a thin white beard. He once joked that he was assured of at least the "baldheaded, bearded vote."

A wealthy former businessman, Epton, 61, had a solid record as a Republican state legislator representing a racially mixed district for 14 years.

But his standing now is the result more of a bitter split in the Democratic Party and racial currents than his abilities or qualifications.

"I know a lot of people are going to vote for me for all the wrong reasons," Epton said in an interview this week.

As if to underscore his point, the campaign turned mean today. Epton contended that he was being victimized by "reverse discrimination," and Rep. Harold Washington, the Democratic candidate, accused him of trying to inject racial overtones into the campaign.

Chicago is one of the nation's most racially segregated cities, and there always has been a racial undercurrent to the mayor's race. But heretofore Epton has tried repeatedly to downplay race.

He also attacked Washington's past legal problems for the first time, telling a radio interviewer, "I think it is extremely unfortunate that a man in my profession" is running against an opponent "with that type of record."

Washington was convicted of failing to file income tax returns in 1972, and had his license to practice law revoked in 1970 for unethical conduct.

Epton's hopes hinge on the fact that Washington won only 34 percent of the vote when he upset Mayor Jane Byrne and Cook County State's Attorney Richard M. Daley in the Feb. 22 Democratic primary.

The primary was one of the most divisive in this city's history of divisive primaries, and it left deep wounds in the party. The first black ever to win the Democratic mayoral nomination, Washington relied on black voters. He got 84 percent of the black vote, but only 6 percent of the white vote.

He has made little effort to court party leaders or campaign in white neighborhoods. He also has refused to back down on his pledges to end the patronage system, the lifeblood of Chicago's Democratic machine for generations.

A host of major party officials, including House Ways and Means Committee Chairman Dan Rostenkowski (D-Ill.), has refused to endorse Washington.

"He tried to discredit the organization during the primary. We were one of his targets. When he won, obviously there was some concern," said Alderman Roman Pucinski, who represents a largely white area. "It's not the easiest thing to sell Harold Washington in many parts of the city. So if committeemen are going to go out and put their reputations on the line, they're going to need some assurances.

"I don't think the organization is in a mood to provide him with a guillotine to cut off its head," Pucinski continued. "If the phone calls we're getting are any indication, there is no question Washington is going to need all the help he can get."

Washington is still favored to win the general election April 12. Sources said a Republican poll last week indicated that Epton would have difficulty getting more than 45 percent of the vote.

Nevertheless, Epton has Washington's campaign worried.

"We regard him as a serious challenger, who could develope into a very serious contender," said Al Raby, Washington's campaign manager. "We can't afford to wake up surprised on election day."

Washington says he believes party leaders will return to the fold eventually, and he was to meet with many of them at a cocktail party tonight, Raby said. "We won the election," he said. "The purpose of the Democratic organization is to support the party's nominee."

Epton was the forgotten man in the primary, ignored by the media and his own party. When President Reagan attended a Chicago fund-raiser for Sen. Charles H. Percy (R-Ill.) last month, for example, Epton was given a seat at the back of the room and wasn't even introduced from the podium.

"The media shut me out completely. I was a non-person," he said. "Oh, they'd put me on the 1:30 a.m. radio call-in shows, but that's all. Nothing I'd rather do than talk to drunks on the radio in the middle of the night."

Epton initially was a relunctant candidate, persuaded to run by party leaders as almost a sacrificial lamb. His primary campaign was a skeleton operation. It had only one typewriter, eight telephones and three paid workers.

This changed after Feb. 22. Within three days, 6,300 volunteers signed up to work for him.

Sensing "a real opportunity," GOP leaders put together a professional campaign organization headed by James L. Fletcher, who managed Gov. James R. Thompson's 1978 campaign. John Deardourff, a well-known GOP media adviser, was hired to produce television commericals.

GOP leaders also reportedly tried to get Epton to step aside and, according to NBC News, even approached Mayor Byrne about taking his place on the ticket. Byrne and Epton denied such reports today.

"That is a ridiculous rumor," Epton said, adding that "under no circumstance and for no reason" would he step aside.

With the election more than a month away, it is impossible to know whether attacks on Washington will help or hurt Epton.

"The only rule in Chicago politics now is that anything can happen--and it probably will," Mike Royko, the Chicago Sun-Times columnist, has written. He noted that Byrne ran against the Chicago machine four years ago and won after spending only $135,000. This year she ran with the machine, spent $10 million and lost.

Washington ran against Byrne, the machine and Daley, heir to a political dynasty, and won, spending only $1 million.

So how ridiculous is the idea that Chicago could elect a Republican mayor?

"I believe it's within the realm of possibility," said Illinois GOP Chairman Don Adams. ". . . That's a lot better chance than we've had for a long time."