Nobles, whether Dukes, Earls, Whatever, owned LAND, whether it had a town or a couple tiny backwater villages on it. If you were making say, a medieval (1200's) Paris, you could do some research on how it was structured politically and socially (I don't happen to know much on that). All the above comments point out some really good things. Some medieval towns were completely founded by merchants. Guilds held loads of power, driving out who they didn't want in the city. Mayors were completely commonplace, as were other appointed officials. You have law-men, sheriffs, provosts; whatever they were called depending on their region and time period, religious leaders (don't underestimate the power over every-day life that they held). There were also kings, of course who oversaw the whole of the land, but how could they function without their ministers, lords, minor nobles, etc. down the ranks. It is also likely that the various factions mentioned would not see eye-to-eye (they never did).
Just a suggestion... if you are modeling your world after a certain earth time period, you might want to read a little about the political and social structure of that period.
When I write a village, a town or a kingdom, I ask myself, "Why does a city council work here? How does this mayor compete with these Guilds/Warlords/ Nobles? Would the king/Mayor?Lord get involved with this, or would the constables/city guard/night watch take care of it themselves?"
KEEP READING IF YOU'D LIKE A LITTLE HISTORICAL VIEWPOINT
A lot changed in Europe between 1300 and 1600 and the social structure of the whole continent changed after the plague, when the population no longer was divided into the very wealthy and the very poor.
The plague killed landowners as easily as it killed beggars, and the result was loads of land left vacant, which was bought up by rising merchant-class families. The Renaissance (1500's) in England was COMPLETELY different than the medieval period. I usually use the 1500's as my inspiration because more people (all but the very poorest) had more freedoms, rights, and opportunities than in earlier periods when social class was a bit oppressing. Also, the idea of more people splitting the power appeals to me because I like conflict. Okay so here's an example of power structure in Elizabethan England: A lord dressed his household staff in livery. When a servant took his lord's cloth, he owed loyalty and services to his lord, but also shared in is lord's exemption from certain laws. Peers could not be arrested except for treason, felony, or breach of peace, and neither could anyone in their livery. Not a bad deal for a common man.
OKAY that doesn't have much to do with who rules a town, but my point was that MANY people could rule the town regardless of the one guy at the top.