The most common method is to not bother. Just use generic animations like most MMOs. One guy makes an attack, the other guy makes a blocking animation. Damage is dealt, numbers appear, everyone is happy.
Now, if you actually give a damn about how your game looks, you need to expend effort.
The idea is fairly simple. To coordinate animations between entities, you need to... coordinate animations between entities. The two entities need to talk to each other and work out which animations each of them will play.
One entity should probably be the "leader" in terms of who's in charge. It dictates when things will happen and how they will occur. Let's say the attacking entity is always the lead.
The attacker informs the defender that he's being attacked. So now the attacker references the defender and vice-versa.
Next, both must select which animation to play. This is generally done by a table or something similar based on the available parameters. For each possible set of parameters that affects which animation to play, you have an entry in the table that says which to play. So you'd have ranges of enemy sizes, self-sizes, ranges of distances to the target, etc.
The attacker and defender play a different animation obviously. But the tables they select from are designed to match: given the same attacker size, defender size, and distance, the attacking animation selected will match the defender's animation selection.
Then they play their animations. Note that timing may need to be involved here. Especially if distance is involved, you generally don't want the defender to be defending until the attacker is close enough. So he won't play his animation until the attacker reaches a certain distance. This requires the defending entity to track the position of the attacker and play the animation at the right time.
Your biggest problem (and the reason why most games punt on it and use generic anims) is likely going to be what happens when a third entity gets involved. If you're already in the middle of a lengthy scripted sequence, what do you do if someone else tries to attack you?
This is generally not a good thing. So oftentimes, you simply say that nobody can attack someone who is attacking/defending currently. In some games, elaborate animations are only used for specialized events. Generic animations are for basic fighting, but you might have a special anim for the final blow.