Commodore is, in naval history, a title rather than a rank, held by a captain who commands a fleet, essentially like an admiral, but without the promotion, and for a limited period of time.
What we’ve seen in Star Trek is that Commodore is a rank. Bob Wesley, in “The Ulimate Computer,” was acting in the traditional role of a Commodore–a captain in command of a larger fleet. Yet we see Matt Decker as the captain of a single ship in “The Doomsday Machine,” with nary a fleet in sight. Perhaps that once a captain is given command a fleet action, he can use the title “Commodore” rather than “Captain” to denote the greater responsibilities once held.
We’ve also seen Commodores in command of starbases. This makes sense, when looked at from the vantage point of commanding a fleet of ships; the commodore would be responsible for the goings-on of the ships in his sector.
The term does crop up in Peter David’s novels from time to time. Data was a Commodore in Imzadi, in command of a single ship, the Enterprise-F.