Yes. In anaerobic bacteria ATP synthase is still utilized as a a means of generating an electrochemical proton gradient for certain membrane functions. It actually works in the opposite direction by catalyzing the hydrolysis of ATP as opposed to the phosphorylation you're so accustomed to seeing.