As I know the country that invaded Afghanistan in an attempt to gain an ally in the Cold War was the Soviet Union. As they needed a support from the other sides. The other options seem not to be right at all because they didn't participate in the invasion in Afghanistan. So choose B. The Soviet Union.