In the Spanish civil war, people came to fight from as far away as the United States. How many, if any, other civil wars involved similar efforts (China for example), of regular people going off to join the fighting from elsewhere?
This is a surprisingly difficult question to answer well, and an easy one to answer badly. The short, bad version is no, no other twentieth century conflict (civil or otherwise) saw a comparable foreign war volunteering movement in either a quantitative (ie the sheer numbers) or qualitative (the means of mobilisation or the disproportionate role these volunteers played in representations/memories of the conflict) sense. But that begs the question as to why, which is where things get tricky because this is not a topic for which there is a whole lot of good historical writing. Nir Arielli's recent book, From Byron to bin Laden, is perhaps the only in-depth, high-quality publication that offers a comparative approach covering the whole century, and even then this question of relative scale is one which I don't think is dealt with all that effectively in Arielli's text, who focuses a bit more on individual motivation.
That's not to say that foreign volunteers were unknown in other twentieth century conflicts - Arielli's book is full of examples, and we can point in particular to the significant contingents of foreigners involved in both the Israeli War of Independence (the original Israeli Air Force was heavily reliant on such volunteers) and the Soviet Occupation of Afghanistan in the 1980s (this is probably the second-largest volunteering movement in the twentieth century, but with the caveat that the vast bulk of volunteers were actually only peripherally involved in the conflict and generally stayed on the Pakistani side of the border, a far cry from the very direct involvement of foreign volunteers in Spain). More broadly, it's actually far from uncommon for conflicts to attract relatively small numbers (dozens or hundreds) of volunteers, drawn to the struggle by politics, religion or ethnic identity. The wars in former Yugoslavia in the 1990s, for instance, saw small contingents of foreigners fight on various sides, most prominently for the Croatians and Bosnians. Any conflict for which a transnational community (whether political, diasporic or faith-based) exists can expect to see at least a few members of that community attempt to take part. The question comes back one of scale - why do the numbers of volunteers involved vary by orders of magnitude?
At this point, it's perhaps easier to focus back on Spain and think about what specific factors aligned in that case to make the number of volunteers so large. The first I'd point to is sponsorship and recruitment networks. It's not impossible for foreign volunteers to make the decision and follow through with it independently (the first few months of the Spanish Civil War saw a small but significant number of such volunteers reach Spain), but this requires an unusual amount of dedication, knowledge and resources - it's not usually easy to make your way to a war zone by yourself. As such, for large-scale mobilisations there are usually one or more recruitment networks involved: groups that can provide the resources and/or connections to help prospective volunteers get to the conflict.
In Spain, this network was provided by the Communist International (or Comintern), the organisation based in Moscow with the remit of coordinating the activities of communist groups around the world. Their involvement in Spain was part of wider Soviet intervention in the conflict, itself a response to significant Italian and German intervention. Unlike Hitler and Mussolini, however, Stalin had no desire (or ability) to send entire armies to Spain, and so recruiting foreign volunteers was the chosen alternative. Comintern was uniquely well-prepared for this task. They'd spent the better part of two decades up to 1936 cultivating the kinds of cross-border networks and connections that were ideally suited to this kind of endeavour - importantly as well, these networks were designed to operate in a clandestine way as communist groups generally anticipated the possibility that they would be banned by capitalist governments (and indeed many were). Basically, if you hd the right (ie communist) connections at home, they could generally arrange to get you to Paris, and the Comintern (relying heavily on the then-powerful Communist Party of France) set up a route to smuggle volunteers from Paris to the south of France and then over the Pyrenees into Spain.
This meant that following the Comintern’s decision to actively organise recruitment in October 1936, volunteering changed profoundly. The volunteers became both more numerous and more cohesive in terms of class, background and beliefs, and recruitment took place almost exclusively within communist networks (as opposed to the much more diverse 'independent' volunteers of the sort that's common to find in most conflicts). This, I would argue, also helped multiply the numbers of volunteers considerably - this kind of decision is much easier to make when made alongside friends and colleagues, and it becomes much more difficult to back out of once made. In the right context, being a Communist Party member was not a hobby – it was a way of life, shaping members’ social circles alongside their political activities. Communism, in other words, was often a community as much as a party. Just as important was the kinds of people who became communists in the 1930s - they were the kinds of people whose frustration with the world demanded action. Communism's chief selling point was the perception that of all left-wing organisations, they were the ones willing to fight the hardest and take the actions necessarily to get stuff done - in other words, their members and supporters were disproportionately the kinds of people itching to get their shot at the fascist enemy, particularly after they'd already lost at home (such as for the Italians and Germans) or where the law prevented them dealing with domestic fascists decisively (as in the US or Britain).
The Comintern was also ideologically well placed to recruit volunteers for Spain, with communism (and, importantly in this period, anti-fascism) is particularly well suited to transnational mobilisation. It's inherently internationalist, meaning that volunteers could readily understand that in defending the ‘Spanish people’, they were defending their own homes against future fascist expansionism. Spain was readily appreciated as the decisive battlefield in the fight against fascism between 1936 and 1939, dwarfing the scale and stakes of the struggle at home. While non-internationalist ideologies have the capacity to cross borders, they are far more reliant on circumstances and perception, and it becomes correspondingly more difficult to frame a conflict as being of such central importance. An example here might be the Soviet invasion of Finland in 1939-40 - many (anti-communist) Swedish nationalists were moved to volunteer, but far fewer (though not none by any means) came from further abroad, even though there was a great deal of sympathy for their cause.
In sum, a lot of factors came together in Spain. It took a pre-existing transnational organisation which had a strong institutional capacity to organise recruitment across borders, and whose target audience may have been relatively small in a lot of contexts, but culturally and politically provided exceptionally fertile ground for this kind of mobilisation. Equally, the very existence and involvement of the Comintern reflected the unique position of the USSR in the interwar period - it was a powerful state but one that was isolated and had a lot of powerful enemies. It was of course in their perceived interests to cultivate a global network of supporters (not least to encourage their revolutionary efforts at home), but utilising them in this way reflected this fundamental weakness: the USSR lacked the tools to intervene more directly and effectively. After the Second World War, not only had the Comintern itself been wound down (after being gutted during the purges of 1937-8 in any case), but the USSR had many more effective tools and proxies available to carry out interventions abroad.