Well, first of all hi to everybody, i'm a newbie in this cryptocurrency thing, so a lot of doubts are in my mind these days.
I have this question, looking here for the answer I didn't found yet, basically the subject says it all.
If bitcoin transactions are irreversible, why some platforms (online wallets, exchanges, etc) need X confirmations to "validate" a transaction?
You answered yourself. Exactly due to fact that bitcoin transaction are irreversible it is wise to wait for at least 1 confirmation of the network.
Unless there is 1 (or more confirmations) there is a risk of 'double spending' of bitcoin.
Double spending risk always exist unless the transaction is confirmed and included in a block before the last Bitcoin checkpoint. Without any confirmation, the risk of race attack is very high. After 6+ confirmation, without significant hashrates, the risk of double spending is reduced. Unless there is a major block reorg which is quite impossible unless your client is bugged.
51% hashrate is a number which miners need for a double spend attack to succeed with 100% chances. The lower the percentage, the lower the chances. Services that require significant amount of confirmations probably do not want to lose their coins at any case for example, exchanges. For normal brick and motar stores, 1 confirmation or even 0 confirmation is enough for the risk to be reduced. That is if precautions are taken.