Re Mode S:
It has a code you can enter for that flight, but also a code in the background unique to the airframe. It is - in computer terms - a MAC address and is used like that for data communications in the background.
Yes, that's a pretty good analogy. The confusion in previous posts probably arises because "Aircraft ID" (ACID) is the term used in the ADS-B spec for the crew-configurable callsign/flight number, as distinct from the aircraft's hardwired 24-bit ICAO address.
Does the 777 let the pilots change the tail number as well as the flight ID?
The tail number isn't transmitted via the transponder, except in cases where it's being used as the callsign for the flight. It can, of course, be ascertained from the 24-bit address, so it's not really necessary.