Several people have reportedly been killed in an explosion at a mosque near a police complex in northwest Pakistan.