according to http://www.answers.com/dago, it is an alteration of Spanish name Diego. As a slur, it was originally directed at those of Spanish descent. When and why it was redirected to Italians is anyone's guess.
According to a 2 hour documentary on the Italians in America, many of the 1st immigrants could barely speak the English language. Therefore, many became cheap laborers. Day-Laborers they were refered to. Then, those Day-o's became Dagos! I struggled for years to find that out! I just found out TODAY how they got to be called "guineas"!