I've recently read some news about foreign volunteers of Syrian civil war. They're seen as a threat to national security in their countries and some of them are arrested. How was the situation for foreign volunteers of Spanish civil war?
In America, during the McCarthy hearings, the leaders of the Veterans of the Abraham Lincoln Brigade were subpoena'ed by the House Unamerican Activities Committee and accused of running a Communist front organization, which they denied. Interviewed decades later, most Abraham Lincoln Brigade veterans claimed to have lost at least one job because of the blacklist; one told a historian (but couldn't provide proof) that the Army was keeping records on him and others and sharing those records with law enforcement, calling them Premature Anti-fascists (and therefore, presumed Communists).
In the later backlash against McCarthyism, the Abraham Lincoln Brigade veterans were adopted as heroes (and/or martyrs) by most of the American left.
About 550 Swedes fought in the International Brigades, and a handful (perhaps about 1-10) i the POUM. Most Swedes served in the 11. International Brigade 'Thälmann'.
About 300 volunteers returned in October, November and December 1938, and while the secret police kept files on some of them, none were arrested. They found problems on the labour market, as the unemployment in Sweden was still about 15% in late 1938. There were no social security net at the time, and many found problems earning a living. About 100 of them were sailors and took to the sea - these men seem to have faced little persecution.
When the Soviet Union attacked Finland during the Winter War, communists were viewed with extreme suspicion and known communists (including the veterans of the Spanish Civil War) were when called up for their conscriptions, put into unarmed labour companies and placed in isolated parts of the forests of northern Sweden to do road construction and other labourous tasks, as they were considered potential 5th columnists. However, since the army had no legal right to force the men to work, many of these labour camps turned into communist study camps instead.
Note that these camps were part of the army - when called up for their conscription or extra service, as all other men in the country, these known communists were given uniforms, but assigned to these labour units instead of armed units. They recieved the same pay, the same leave and the same food as the rest of the army. They were released when the conscription time or extra service time was over with a ticket for a train ride home, as were the armed soldiers.
The camp system was abandoned in 1943 and known communists were allowed to serve in armed units again.
Source: Svenskarna i spanska inbördeskriget 1936-1939 (The Swedes in the Spanish Civil War 1936-1939), by Lennart Lundberg, ISBN: 917029 457 7.
(Apologies if this turns into a mammoth post; the Spanish Civil War is sort of my specialist subject - I wrote tens of thousands of words about the war in my final year as an undergrad, and so I will tend to talk about it until the cows come home. But here goes...)
Given the political profile of many international fighters in Spain, there were many foreign volunteers who weren't able to return home at all (even prior to the war). Take for example the predominantly German Thälmann Battalion: many of these men were already living in exile having fled repression at the hands of the Nazis. From 'Germans Against Hitler: The Thaelmann Brigade' by Arnold Krammer in the Journal of Contemporary History:
The diversity of the political composition of the brigades is borne out by a German volunteer who states that in his battalion 'possibly one-third were absolute communists, one-third a mixture of liberals, German Jews, socialists and others who were democratic anti-Nazis, and one-third were soldiers of fortune and youths attracted by adventure and war'.
Many of the volunteers in the two German battalions were anti-fascist refugees who could not return to their native land; they had fled Germany with bitter memories of imprisonment and persecution and were anxious to demonstrate their condemnation of the acts perpetrated by their countrymen under national-socialism.
The same is broadly true of the Italian Garibaldi Brigade, which was formed in Paris and composed primarily of liberal/left-wing Italians living in exile from Mussolini's Italy.
As /u/InfamousBrad pointed out, the Americans who had served in the Abraham Lincoln Battalion faced significant suspicion during the Second Red Scare. From Victor Hoar, in his review of In Our Time: The Abraham Lincoln Brigade and the Historians:
Nearly eight hundred veterans served in World War II, and while many saw combat and were casualties, others never cleared the continental limits because one or another government agency thought they might be politically unreliable. The men came home a second time, suffered through the McCarthy years and through an investigation by the Subversive Activities Control Board which, in 1955, declared that the [Veterans of the Abraham Lincoln Battalion] was a CPUSA front. This decision was rescinded a decade later.
Both Britain and France, the countries most committed to non-intervention, forbade their citizens from fighting in Spain, but did relatively little to punish those who did. Recently-released archives show that the Security Service monitored Britons who joined the International Brigades, but as Tom Buchanan notes (emphasis mine):
One point that does emerge strongly, however, is what a close eye British intelligence kept on the potential volunteers at the ports, and how unwilling they were to prevent their departure. The British government was loth to use the 1870 Foreign Enlistment Act, fearing that if a case came to court it could not secure a conviction, and would face political embarrassment.
The British International Brigaders' return to Victoria Station in London was something of a left-wing fete; they were met by, among others, Labour party leader and future prime minister Clement Attlee.