I am a non-EU, non-UK traveler. I am going to Italy but all flights have connection in either Germany or France.
Will my passport be stamped in Italy at my destination, or when I enter France/Germany for the connection?
When you fly to Brazil and connect to a domestic flight, for example if flying to Sao Paulo via Rio de Janeiro, you still enter Brazil in Rio and thus get your stamp there.
Same thing here, because the Schengen area is effectively a single country. Since you're making a "domestic" connection (France-Italy or Germany-Italy) you need to clear immigration in France or Germany and get your stamp there.
Make sure you do get stamped, as many officers (especially in France) are too lazy to do it, and contrary to popular belief, entries and exits to/from the Schengen Area are not electronically recorded