Hashes # are actually part of URLs as anchors ("jump marks" tied to the id attribute of an HTML element or formerly the name attribute in old HTML versions). I am not sure it is possible at all, at least I never tried any filename containing it ever…. In any case there is no actual setting to allow or disallow in Zenphoto at all.
I am sure we already recommend to avoid all special chars in filenames. It really makes your life (and that of your visitors) so much easier in many places.