It is illegal to work while on a tourist visa. If you are found to be working on a tourist visa, you could be fined, prosecuted, deported or even jailed. Some countries may go as far as banning your for several years or indefinitely. Volunteering and unpaid work often requires permission or a specialised visa from the consulate or embassy, and needs to be arranged prior to your travel.
Not abiding by the restrictions of your visa can have consequences when visiting other countries around the world.