This question already has an answer here:
As the title says, can a blocking creature fight? If so, what happens if the blocking creature dies before damage is dealt? How would damage be dealt during combat?
Example: Creature A is a 2/2 and it is blocking creature B, which is also 2/2. Before combat damage, I cast an instant forcing creature A to fight creature C, another 2/2, so that both A and C die.