W. Wilson Goode ran very well in the white neighborhoods in winning the Democratic mayoral primary here Tuesday, but his exit polls ran even better than he did.

Goode won an estimated 23 to 25 percent of the white vote in his 53 percent to 46 percent victory over Frank L. Rizzo. That makes him one of the most successful "crossover" black candidates in American political history.

He was substantially more popular, however, among whites who filled out exit-poll questionnaires. A sample of 2,065 voters drawn Tuesday by Teichner Associates Inc. for the local CBS-affiliate television station showed that 36 percent of whites said they had voted for Goode. The disparity between the exit poll and actual vote has led to a good deal of clucking here about the hidden "hypocrisy quotient" in elections that pit a black against a white.

There was a similar phenomenon in the California governor's race last November. Tom Bradley, the black mayor of Los Angeles, won the exit polls there but lost the election.

"When there is a black in the race, people lie to the pollsters," said Neil Oxman, Goode's media consultant.

Many Goode supporters believe that whites are more prejudiced than they like to let on. But the triumph of Philadelphia in this campaign was that "at least the city had the decency to keep its bigotry to privacy of the home and the voting booth," one high-level Goode supporter said.

Goode also won 91 percent of the black vote, with Rizzo getting 4 percent and a third candidate picking up the rest.

Patrick Caddell, who has polled this year for both Goode and Chicago Mayor Harold Washington, said today he was struck by the differences in the two campaigns and the similarities in the outcomes.

In Chicago, which has a racial and ethnic mix similar to Philadelphia's, Washington got about 18 percent of the white vote in an election marked by overt racist appeals on both sides.

In Philadelphia, race was never a part of the dialogue or dynamic of the campaign, "but it is a joke to suggest that it wasn't a factor," said Caddell. "It is a factor with a lot of complexities and calibrations. People are basically fearful of change." Caddell and the rest of Goode's campaign strategists were hopeful today about the fall campaign, and seemingly with good reason.

Democratic City Committee Chairman Joseph Smith, who supported Rizzo in the primary, came out strongly for Goode, and estimated that of the city's 69 Democratic ward leaders, "there won't be more than one or two defections."

Rizzo, who never made a public concession, congratulated Goode by telephone today and was expected to talk in person about an endorsement later this week.

Moreover, Goode forces were cheered by the continuing resolve of former city controller Thomas Leonard to remain in the general election as an independent candidate. The orthodox wisdom is that Leonard, who is white, will draw fewer votes from Goode than from the Republican nominee, John Egan.

Egan, 39, a high school dropout (he was kicked out of a Roman Catholic school for smoking) who started as a messenger boy at the Philadelphia Stock Exchange and rose to become its chairman, won the GOP primary handily over former representative Charles F. Dougherty and former basketball star and city controller Thomas Gola. Egan was a Democrat until the weekend before he was recruited by local GOP boss William Meehan into the race--but Goode plans to campaign against the Republican Party. "This campaign will be against John Egan and Ronald Reagan," he said today.