The city or town council has power to regulate, restrain, or prevent the carrying on of manufactories dangerous in causing or producing fires.