Volunteering is allowed provided it is not the main purpose of the visit, it is for a registered charity and will be for no longer than 30 days in total. It should not be a contractual position.
There is a legal difference between volunteering and doing voluntary work. Voluntary worker is under a contractual obligation to the charity. This is not allowed for visitors. There is a special visa for this type of work – see Tier 5 voluntary worker.