Racism and nationalism are different but IMO closely aligned. Both asserting that your race or nation is superior to the exclusion of others. History shows you end up in the same place.
Whereas patriotism, wanting the best for your country, is a good thing. In the last decade political parties around the world have rediscovered that the intentional blurring of nationalism and patriotism works to their electoral advantage.