Yes a mayor can enact and make new laws for the town.
However the laws have to go through a meeting and then the city council has to decide on whether or not the new law would benefit the town.
Even for ordinances the mayor has to deal with the city council first and then go through the process of making the ordinance an ordinance that can legally be enforced.
Also the police or someone has to be able to enforce those laws.
Without anyone to enforce the new laws that the mayor and council sign into law then the law or ordinance is a mute point.
The mayor has a lot of power over the city or town they are mayor in but they also have to go by what the city council decides as well.