Undated (AP) _ Philadelphia Mayor W. Wilson Goode defeated two Democratic primary challengers and tough-talking ex-Mayor Frank Rizzo got the GOP nomination to face him in November, while Denver's Mayor Federico Pena was forced into a runoff.

In other elections Tuesday, Pittsburgh voters scrapped a 76-year-old system for electing City Council in favor of one that blacks hope will give them more clout, and voters in Oregon approved a tax measure designed to keep schools from shutting down for lack of money.

The Philadelphia primaries set up what's likely to be a fierce and familiar campaign in the nation's fifth-largest city. Rizzo and Goode first met in the Democratic primary of 1983, when Goode won and went on to become the city's first black mayor.

Goode has been dogged by allegations of incompetence and mismanagement since the 1985 battle with MOVE, in which police bombed the radical group's rowhouse, starting a fire that destroyed 61 homes and killed 11 people.

Rizzo, a 66-year-old former beat cop and police commissioner with a law- and-order reputation, has sought at nearly every turn to make the MOVE siege an issue.

''I'm going after Wilson,'' Rizzo said. ''MOVE will be an important part of it. I'm going to talk about it and not only the bomb dropping.''

Rizzo, who served two terms in City Hall as a Democrat in the 1970s, switched to the GOP to take on Goode this time. More than 50,000 Democrats followed, although the last Republican mayoral victory in Philadelphia was in 1937.

With 97 percent of the precincts reporting, Goode had 219,274 votes, or 56 percent to former District Attorney Edward Rendell's 168,859, or 44 percent. Bernard Salera, a librarian, had less than 1 percent.

On the GOP side, which is outregistered by Democrats 3-1, Rizzo got 72,648 votes, or 58 percent, to stockbrocker John Egan's 52,107 votes, or 42 percent.

''One down and one to go,'' Goode, 48, shouted to supporters.

Rizzo vowered to give Goode ''the toughest 'one to go' he's ever going to get.''

In Denver, with all precincts reporting, attorney Don Bain, the only Republican in a non-partisan race, won 58,003 votes, or 42 percent, to Pena's 51,650, or 37 percent. State Sen. Dennis Gallagher was third with 13 percent.

Since neither Bain nor Pena, the city's first Hispanic mayor, won 50 percent, they will face each other in a runoff June 16. Five others on the ballot all received less than 5 percent.

Pittsburgh residents voted to replace the 76-year-old at-large system of electing city councilors in favor of a district system allowing greater representation by blacks, who constitute 18 percent of registered voters.

The district system received 68.6 percent approval and the at-large system received 52.9 percent approval. The district proposal probably will not take effect until 1989, county officials said.

In other elections:

-In Oregon City, Ore., a three-year property-tax levy that the Clackamas County sheriff said was necessary to keep deputies on patrol was approved by a 2-to-1 margin. The levy will raise $33.8 million to operate the sheriff's department through mid-1990. County officials said a defeat of the measure would have forced the layoffs of about 130 deputies.

-Denver voters also defeated by a margin of more than 2-1 a referendum requiring the city to provide safe shelters for the homeless. Washington, D.C., is the only city with such a provision. The measure was endorsed by 50 civic and religious organizations, but was opposed by most of Denver's City Council and some organizations that provide shelter.

-On Washington state's coast, the fate of Pacific County Sheriff Jerry Benning's five-deputy department hung in the balance with a $600,000 law enforcement tax levy on the ballot. The measure won 59.4 percent approval, but needed 60 percent to pass. Sixty-four absentee ballots to be counted in about 10 days could put the measure over the top, officials said.

The county of 17,200 people had to reduce the force to five deputies from 10. Failure of the tax levy would mean a cut to two deputies, he said.

-In Oregon, voters approved a ''safety net'' plan that would allow school districts to re-levy the previous year's property tax without resubmitting it to voters.

In the past decade, nine school districts have closed their doors as long as 37 days after voters rejected property tax measures.

-Residents of rural Mifflin County, Pa., voted 2-1 in favor of a non- binding referendum asking that the United States ''join the Soviet Union in a mutual weapons-test ban that can be checked by both sides.'' Similar questions put before voters in previous elections in Chicago and Fort Collins, Colo., passed with overwhelming support.

-In Pasadena, Calif., a ballot measure to allow the demolition of the historic Huntington Sheraton Hotel's main building was approved by voters by a 7-5 margin. The vote clears the way for a developer to raze the six-story main building, built in 1906, and erect a look-a-like.