Masks were not mandatory in South Korea till well past the peak, though they are commonly worn.
Masks were not used in New Zealand which has had one of the best responses.
Masks are a useful low-cost measure but they're not sufficient on their own, quarantine and test and trace is far more effective and is probably what allowed those countries to get on top of their outbreaks so quickly, though honestly I'm not sure anybody knows the answers as yet about variations in infection and spread - we'll know a lot more in a few years in retrospect.
There's a common thread in most of the countries that have done incredibly badly though - the leaders have downplayed the risk and refused to take common sense measures to stop the spread (UK, Brazil, US).
I see mask a sort of like logs in warships used to plug leaks during battle. Cheap, easy to source and relatively effective enough in a pinch... at least enough to buy time for a proper response.
Might not be as effective as prepping before hand with better design, response or tactics. But you make do with what you got, competent leader or not.
Effectively the name of the game for the whole world is to buy enough time for a Vaccine to be created... or maybe for the virus to hopefully mutate into a more survivable form perhaps.
Every country that made masks mandatory and distributed them effectively, did well.