I looked it up, it's racial for all mediterraneans, and it might be from the common spanish name Diego like a couple of sources say, but wikipedia says this:
The term may have originated following British or American encounters with Portuguese and Spanish sailors. "Diego" is the Portuguese nickname for any deckhand. After transforming into "dago" in English and becoming a common term for Spanish and Portuguese people, the slur expanded in usage to then refer to Italians and Italian immigrants, another Mediterranean and Latin ethnic group.