But given how much we know about the previous command histories of other captains, I think it's an interesting little oddity of the original series (and movies) that we never got a definitive and unambiguous answer one way or the other onscreen.
Well, '60s shows were more concerned with the here and now for the characters, unless it was convenient for the story to bring in an old friend or lost love or family member we'd never heard of before. We did learn a fair amount about his career as a cadet and junior officer, but nobody ever came up with a story focusing on his first command, just by luck of the draw.
Indeed, luck of the draw seems to be all it's down to; I'm not criticising anyone for omitting it. I just find it a curious little factoid that this particular piece of information never turned up onscreen - look at the various many snippets of information about his career or past loves that were mentioned in various episodes or in the likes of TWOK, TFF and GEN. We know the name of Picard's first command, Sisko's previous ships etc.
It's almost the sort of 'fact' that I'd have expected to be mentioned in TAS and then to be adapted as canon, the way that Kirks' middle name was.