As a very general statement, there are circumstances where it is legal to kill a dog that is posing a threat to an individual or livestock. I would consult a local attorney about the circumstances in your state. Merely "threatening" and "being off leash" may not enough.
This is not to be construed as legal advice. I do not have an attorney client relationship with you.