True donations are not taxable in the UK, because they are not part of a trade.
In other words, they are not given in exchange for something; the something is freely given without the donation.
Of course there is the question of whether something is truly a donation. But charities have to deal with that question, so there are formulaic approaches to it, and advisors. Sometimes the wording that accompanies a donation must be written carefully, to clarify what is and is not expected for it, because donations can be directed to a purpose, which isn't (apparently) the same as paying for something.
I assume it's similar elsewhere?