Both are true.
Police will call "shots fired" on their radio to alert any other police arriving at that place, that the situation is dangerous.
However, this is imitated to be funny. If a person says something mean or offensive to another person, then it would usually be a third person present, who might joke, "Whoa. Shots fired." They are joking about the fact that the situation just got hostile, and it is usually a hint to the people involved that they are being hostile and should stop.