Any jurisdiction can pass a law unless there's a law against doing so.
For example, you couldn't do this in Massachusetts. A city would first have to petition the state for a new law allowing the city to pass such a local law.