There are several answers, depending on the circumstances.
If they are both yours, and this is a very occasional occurence, try to totally ignore them not even looking at them or saying anything. It is very difficult to do, but they will often just swear at each other and maybe get on their hind legs, and if you intervene they both think that is the green light to go ahead.
Whichever one you grab will make the other one get a better hold as you try to pull it away. If they mean business try to manoevre them to a doorway and slowly close the door between them, forcing them apart. If one has got hold of another and things are not looking good, you can put something like a broom handle through the collar and twist, cutting off the air supply (drastic situations need drastic measures - had to do this with two male Rotts once) but you have to get the other one away asap when the first one lets go.
Water pistols, cans with stones in, and sometimes just banging a door or ringing the bell can distract them but only if they are not intent on killing each other.
If this is a regular occurence, then you need to ask whether it is fair to keep them together. This is particularly the case with bitches, dogs will fight and forget, soon licking each other's wounds, but bitches wait until the next opportunity to get one over the other one. The only answer with bitches that fight regularly is to rehome one.
Just be very careful how you intervene, because dogs do not consider you when they feel vulnerable, and if you grab them they think it is the other dog hurting them.