Obviously the ruler can,
If a Duke has an extra city can they declare that a new duchy?
Can the Marquis of a city declare that a new duchy?
I am of course speaking mechanically. Naturally these actions would be treasonous in certain circumstances (not that it would stop people from doing it).