I’m going to e going from Lucerne Switzerland to Como italy by train and I’m not sure if I need to book my ticket through a Swiss train company or Italian?
Technically you can buy from www.Trenitalia.com OR www.sbb.ch/en. I would be inclined to buy from SBB if my journey started in Switzerland. Another option which is a very easy site to use is www.Trainline.eu.
The Italian site will only show you the once daily direct train, may be at a lower price because of the exchange rate, and you must be able to print it at home, as you can't pick it up at a Swiss train station.
SBB will show you the many daily connections through Arth-Goldau.
I assume you mean Como town, and NOT somewhere else along the Lake Como (like Varenna for instance).
"Como S. Giovanni" is the first station after the border.
Definitely look up times on the Swiss site ( https://www.sbb.ch/en ), because as previously stated the Italian Railways site does not show Swiss internal trains. You can either buy online, but you do not need to buy in advance, you can buy a ticket at Luzern station on the day or beforehand.