Auvestara
In short: Yes and free of charge if that “carrier” is stowed like other hand luggage (e.g. luggage rack, under or behind seat, etc.) Should you however insist to have the carrier with Sweety placed on a separate seat next to you, then you’d need to buy an additional half fare ticket for the same route as for yourself.
The detailed rules regarding pets/animals are found => here in section 8 (German only, you might want to send that chapter through some online translation tool).
No idea about the Chiasso - Milan stretch on Italian territory, as different rules might apply abroad, possibly also depending on whether you’re travelling in a SBB or Italian train.
Maybe someone else could chime in here.