There are no Swiss trains in Italy (except North of Domodossola…), and no Italian trains in Switzerland… So you would need to buy a ticket Milano - Chiasso. You can do that on line from Trenitalia, or do it at the station in Milan.
Basically on that route all trains are Italian till Chiasso, and Swiss North of Chiasso, and that regardless of what logos or colours are on the train set itself… So your Day pass covers all trains (and all other public transport) once you are past Chiasso.
So if you for example indeed travel via a schedule that involves a train Milano - Lugano, and another Lugano - Luzern then you need a ticket Milano - Chiasso valid for that train. Then you can just stay on the train in Chiasso. Use www.sbb.ch to plan trips.