PHILADELPHIA, NOV. 3 -- Mayor W. Wilson Goode (D), whose political future was nearly buried amid the rubble of the 1985 MOVE bombing, appeared headed for reelection tonight over former mayor Fank L. Rizzo (R) after a bruising and bitter campaign.

With 99.2 percent of the precincts reported, Goode had 51 percent of the vote and was clinging to a 14,500-vote margin of the 648,000 votes cast. While polls by one local television station, WCAU-TV, projected Goode the winner, his apparent victory margin was much tighter than expected and appeared to reflect widespread dissatisfaction with Goode's first four-year term.

Another television poll showed the mayor winning 96 percent support among blacks, as expected, and 20 percent of the white vote, the level his strategists said he needed to achieve a narrow majority.

"I am not going to concede tonight, by no stretch of the imagination," Rizzo said. Citing Goode's lead, he said, "I'd be hiding my head if I won by that margin if I was an incumbent mayor."

Shortly after midnight, Goode claimed victory anyway, saying "we have now put the past behind us."

Turnout was reported strong in both Goode and Rizzo strongholds. Rizzo's chances for an upset had rested on hopes that his white ethnic supporters would turn out in substantially greater numbers than black voters.

A defeat would end the political career of Rizzo, 66, the rough-hewn former police commissioner who ran this city from 1971 to 1979 when he was a Democrat. This was actually Rizzo's third come-back attempt; he failed in a campaign to abolish a two-term mayoral limit, lost the 1983 Democratic primary to Goode and tried again this year as a Republican.

Philadelphia's mayoral contest was among the most hotly fought of the dozens of municipal contests featured in this generally quiet, off-year election. In other big-city elections:Miami: The current mayor, Xavier Suarez, is being challenged by former mayor Maurice Ferre. Suarez, the nation's first Cuban-born mayor, won the most votes but failed to gain a majority, forcing a Nov. 10 runoff with Ferre, the 12-year mayor he unseated in 1985. Nearly complete but unofficial results showed Suarez with 18,889 votes (43 percent) to Ferre's 14,324 (32 percent.). Houston: Kathy Whitmire easily won reelection to a fourth term as mayor. With half of the votes counted, she had 73 percent. The next six candidates split the rest. San Francisco: Voters chose a successor to Dianne Feinstein (D), who served her legal limit of two consecutive terms. Eleven candidates were on the ballot and a runoff is expected next month. Indianapolis: Mayor William Hudnut (R) is expected to be elected to his fourth term, despite a last-minute flurry when it was discovered he had written a letter asking to be considered for a college presidency at the same time he was telling voters he intended to stay in office for another term. Boston: Mayor Raymond L. Flynn (D) easily defeated city Councilor Joseph Tierney in his reelection bid. With 225 of 252 precincts reported, Flynn had 55,895 votes to Tierney's 27,513. Other Cities: In Hartford, Conn., Democratic state legislator Carrie Saxon Perry defeated Republican Philip Steele. Perry will become the first black woman to lead a major northeastern city. With all but two of the city's 23 precincts reported, Saxon Perry led Steele by about 8,500 to 7,350. In Gary, Ind., Democrat Thomas Barnes, who ousted veteran Mayor Richard G. Hatcher in the Democratic primary, easily defeated Republican Thaddeus Romanowski. With 97 percent of the vote in, Barnes has 22,699 votes Romanowski's 1,111. In Salt Lake City, Palmer DePaulis was favored for easy reelection.

In Charlotte, N.C., Republican Sue Myrick upset two-term Mayor Harvey Gantt, a Democrat who was the city's first black mayor. With 99 percent of the precincts reported, Myrick led 47,311 to 46,296.

In Philadelphia, Goode, 49, a low-key man of few words, has survived four years of political travail that would have sunk most candidates. But as Philadelphia's first black mayor, he drew on a deep reservoir of supporters who seemed willing to overlook his many embarrassments. He presided over the bombing of the radical group MOVE and then botched the rebuilding of the 61 rowhouses destroyed by fire as his handpicked developer was indicted for fraud. He is widely perceived to have presided over a deterioration of city services and to have lacked the political clout to push through solutions.

Yet, Goode's near-total support among blacks, 39 percent of the electorate, gave him an unshakeable base. He turned back a strong primary challenge and successfully shifted the election's focus from his own four-year record to Rizzo's tumultuous reign.

Rizzo initially tried to project a softer image but soon reverted to his slashing campaign style, accusing Goode of causing the deaths of 11 people in the bombing. The result was one of the nastiest campaigns in the country this year.

Since their only televised debate last month, when the Democratic mayor and his Republican challenger traded charges of "liar" and worse, many voters have become disenchanted, and the election had hinged on which candidate could get his core supporters to the polls.

"Rizzo failed to give people a convincing reason to vote against Wilson Goode," said Paul Maslin, the mayor's pollster. Some polls showed Goode winning the October debate by 3 to 1 among those with who gave an opinion.

In the first salvo in a tough ad campaign, Rizzo had tried to soften his image, stressing his support for day care and the arts. Since then, his commercials have reflected his slashing campaign style, in which he has repeatedly attacked Goode for the 1985 MOVE firebombing.

Rizzo's final ad accused Goode of bringing "international disgrace and ridicule" to Philadelphia, flashing MOVE headlines and a cartoon showing Goode as a fighter pilot dropping a bomb. Earlier ads dealt with the scandal-plagued rebuilding of the row houses destroyed in the bombing and the mayor's acceptance of free suits from a local union leader.

"We were successful in convincing people that Wilson Goode is the worst mayor this city ever had," Elliott Curson, Rizzo's media adviser, said. He said that Goode "doesn't have a focused message. He hasn't done anything positive on himself."

Indeed, Goode's media campaign has been devoted more to blackening Rizzo's reputation than defending his four-year record. Only a final ad, showing Goode kissing a baby, has stressed positive themes.

Earlier Goode ads assailed Rizzo as "a mayor out of control . . . . He tore our city apart once . . . . Can we afford Frank Rizzo again? " One spot showed a 14-year-old photo of Rizzo failing a polygraph test, while another featured a polygraph needle bouncing wildly as Rizzo's promises were recited.

Maslin defended the negative approach. "When you get up against someone who's distorting his past, pulling the wool over everyone's eyes, we have an obligation to set the record straight," he said. "I think the real Frank Rizzo emerged in this campaign."

Curson, however, dismissed the Goode ads as "just firing up the blacks."

Strategists in both camps conceded that the media campaigns have served mainly to reinforce opinions. "People in Philadelphia know these two individuals backwards, forwards and sideways," Maslin said. "They know the things about them that they like and don't like."