Being a doge is almost always advantageous. Also this won't work on Muslim Religions or Merchant Republic for the Gender Succession law is hard coded. Keep in mind that each dynasty can only control one family palace. Testing shows there is a game-breaking bug, as the character counts holdings in province that is capital, instead of trade posts, which results in incorrect trade post counting and you are unable to construct more trade posts.
Doges might approach independent rulers with proposals to ally in an embargo against a competing republic.