I think Ace 100% had the potential to become a yonkou given enough time. Usually, going under someone (as opposed to being your own captain) tends to put a cap on your success in the One Piece world. However, Whitebeard actually had plans of making Ace the PK and presumably would have had Ace take up the mantle as captain after WB eventually died if not for all the Blackbeard stuff.
Ace's potential was pretty insane. It took him at maximum 100 days to go from having no chance against a yonkou to causing some damage. That is unfathomable, Luffy couldn't even begin hurting BM and Kaidou coming off of Dressrosa and WCI respectively and besides BB (who has shown to be relatively poor with haki so far) I think the same would have went for any yonkou whether that be Shanks or Whitebeard.
Additionally, he had pretty good control of his fruit that was really shown when he was fighting Blackbeard. Once Ace stopped being a hardhead and decided to really learn how to implement haki properly, he would've easily reached at least 1st commander level. Most of what Ace learned concerning hak iwas instinctual, according to the Ace novels he first used armament by instinct when he was fighting a VC in Saboady right before Ace and his crew would go to the New World. Then his armament presumably got even better being that he was finally able to cause some damage to Whitebeard after 100 attempts to assassinate him. Unlike Luffy, Ace presumably never got a chance or at least made use his crewmates to learn haki in-depth. [Of course this is in large part due to the fact Oda hadn't fleshed out haki when Ace was directly relevant to the story.]
Even with all this said I am mostly referring to Ace's potential were he to continue living post-Marineford. Not everyone is Luffy and gets people to construct his foundation for haki and teaching them the advanced form on top of that. [Luffy and Sabo might be the only ones in the story tbh.] Given enough time Ace would have definitely become a yonkou (if BB didn't exist) like Kaidou and BM did eventually.
However, as far as how powerful was Ace at the time of his death, I'd say he was right on the cusp of 3rd commander level along with people like Cracker and Jack. 2nd commanders and people who I think could be 2nd commander level have shown too much for me to consider Ace a proper 2nd commander in terms of power despite his title. I won't mention Queen (since this is "in General"), but Jozu was actually able to damage Aokiji (even if it was off guard). Queen has shown some amazing stuff as well.
Then I don't think Ace having been 1st commander level should even be discussed in any serious manner. 1st commanders so far have some seriously broken traits that put them above everyone else in there crew so far save their captain. Katakuri has future sight and Marco has his broken DF. Sabo has possibly the final form of advanced armament in the form of Ryuusouken and now he has a DF on top of that. 1st commanders are monsters to everyone who isn't an admiral or a yonkou and Ace just wasn't that.
Depending on what you think of Vista you could rate Ace even lower to around Snack level. But, due to Ace not being a meathead (see his battle with BB) and being pretty versatile for my personal opinion I have him barely edging out a win over most any 3rd commander, but losing to a 2nd.