You can be a nationalist or a socialist, but you can’t be both.
A nationalist is someone who prioritises allegiance to a national group ahead of other political considerations. Thus those Labour politicians who talk about 'the will of the British people' as a trump card in politics are nationalists – just like the fascists who shout out "Britain First." Of course, there are many different varieties of nationalists. Politicians and parties combine their nationalism with other political objectives; and some varieties are far less odorous than others. Yet whatever the type, there are two reasons why socialists do not embrace nationalism.
First, the nationalist, by virtue of making the national group the most important factor of identification, creates a dichotomy between those who are members of the defined national group and those who are not. People are divided, favoured and discriminated against by characteristics that they cannot, or at least cannot easily, change. Socialists, in contrast, are universalists, whose politics embrace people irrespective of nationality or ethnicity. Nationalism and socialism cannot be combined because one negates the other.
Second, the nationalists’ construction of the concept of a nation is a historical undertaking, which involves looking backwards to find historical customs, myths, language usage, etc. which supposedly bind the people of the nation. By looking backwards, nationalism tends to be conservative and finds its ideals in the past. Socialists, in contrast, believe in freeing people from historical oppressions and see the ideal world as something to be created by human beings in the future. And that future is based on what is progressive from a combination of all human history, not that of one nation.
Internationalism is not the opposite of nationalism. Internationalism involves the recognition of different nationalisms and works for them to coexist on a friendly and cooperative basis. The opposite of nationalism is anationalism (or cosmopolitanism), which seeks the unity of people irrespective of nationality or ethnicity.
One thing should be made clear. Someone who calls for autonomy or independence for a territory, is not for that reason alone, a nationalist. For instance, the demand for an independent Scotland can be less nationalistic than those wielding the unionist rhetoric of the 'integrity of the British nation.'
In England Brexit has fuelled nationalism, and socialists need to confront it.