The answer to that question is not straightforward. According to the Dillon Rule, which is a legal principle that originated in the United States, local governments are subordinate to state governments and can only exercise powers granted to them by the state
However, some states, including Oregon, have adopted home rule charters that allow local governments to exercise more autonomy over local affairs.
In general, home rule charters can override state law as long as they do not conflict with federal law or the state constitution. In general, state laws can preempt any local law as long as they are pursuant to "substantive social, economic, or other regulatory objectives" regarding civil law.
Regarding criminal law, state preemptions are applied differently due to this in the Oregon Constitution: "The legal voters of every city and town are hereby granted power to enact and amend their municipal charter, subject to the Constitution and criminal laws of the State of Oregon".
In short, anything in any charter that can conflict with state or federal law or constitutions can be taken to court and struck down.
Want to read more? Check out a very detailed analysis in the Oregon Municipal Handbook.