It wouldn't stretch credibility too much if we assume that Kirk "merely" served as a first officer somewhere prior to assuming command of the Enterprise IMO. Remember that most first officers on Star Trek are depicted as quite competent and seemingly capable of commanding a ship on their own already.
Was Spock ever depicted as any less competent as a commander in comparison to Kirk? I wouldn't think so, Spock just wasn't interested in commanding a ship. Given their age difference, Riker was probably less exprienced than Picard, but he was nonetheless qualified to command a ship (he had actually turned down a command of his own in order to serve as Enterprise's first officer). There was also no evidence whatsoever to support the assumption that Chakotay may have been in over his head as captain of Voyager.
The command capabilities of first officers are usually depicted as being on par with or almost equal to actual captains. So maybe Kirk has served as first officer of a starship for a couple of years before becoming captain of the Enterprise. This doesn't neccesarily mean that he was an inexperienced or even inept officer when assuming command of the ship.