You could volunteer but not if you were doing something that could benefit you professionally, even if you aren't getting paid. I often get asked if someone could work as an unpaid intern, for example, and my view is that they can't because they would be providing a service and receiving a benefit. The benefit wouldn't be money, but would be experience.
Volunteering at a homeless shelter, museum, soup kitchen, etc is fine, assuming this is not your profession. There is no official document that allows this, it is just allowed because most people don't consider this to be "working"