I don’t think there is one right or wrong answer to this.
It is possible to volunteer at a particular organization/facility that is not directly related to your job and over time people there will get to know you and your particular abilities and work ethic. A job may be created for you or open up in the course of time (while volunteering or after) and you may be the most likely candidate because they already know you and your capabilities.
A volunteer experience shows an employer that you are a well-rounded person. It can fill gaps in your resume and serve as a job despite the fact it is unpaid. Make sure that you list your volunteer experiences as you would a job so that potential employers know what kind of experience you have acquired (you can make a lot of activities you perform relevant to what field you are going into). Use active verbs, be specific, and quantify your accomplishments. This shows that you just weren't a warm body filling in a space and that you acquired skills that are relevant in the process.