You are free to volunteer while you are receiving benefits as
long as the work you do is unpaid.
Volunteering shouldn’t affect your right to benefits, as long as
the only money you receive is to cover your volunteering expenses,
such as travel from home to the volunteering location. For
example if you receive Jobseekers Allowance you must still be
actively seeking a full-time job, able to attend job interviews at
48 hours notice and available to work at one week’s notice.
You must declare all your expenses to your Jobcentre Plus
office. If the only money you receive is to cover the cost of your
expenses from volunteering, your benefit will not be
affected. If you receive any money apart from money to cover
your expenses this will usually be treated as income and taken into
account when assessing your benefit.
For more information on this topic see
this direct.gov page
There is also a leaflet you can download titled
"Volunteering while getting benefts"