He hasn't really lost against anyone other than Kaido. Luffy shouldn't lose to anyone other than maybe Blackbeard
He lost at least 2 times to Crocodile, He lost to Magellan, He lost to Enel once, He lost to Katakuri most of the fight and Katakuri let him Win in the end, that's a loss in itself.. He lost to Monet, He lost to Ceasar Once, He lost to Smoker in Loguetown, He lost Ace because he wasn't strong enough.. He lost to Aokiji, He lost to Doflamingo Once, he would have lost to Cracker if not for Nami, He got demolished by Sanji, He lost to Big Mom's punishing army, He lost to Kizaru, He lost to Arlong once by sabotaging himself.. Probably forgetting some..
Luffy is a Walking L and he can do that because he's the main Character of the series with Unlimited Plot Armor..