The answer depends on local laws. Many laws say the horn is an emergency only device. Some jurisdictions may ticket you for using it in non-emergency situations.
But -- I have seen a roads department sign posted at a dangerous, blind "T" intersection without other controls that said, "Honk Horn."
You should honk in emergencies to alert other drivers to the danger if you believe they haven't realized it. Unfortunately, some drivers are so distracted by a sudden honk that they lose control of the situation.
I believe that flashing your lights is generally against the law in the U.S. It's considered a courtesy in some countries to let people being overtaken know they should move right to allow the pass. WithIn some cities using the high beams in any way is illegal.