I find it can be most confusing! I am responsible for organising crew matters in the UK for a foreign airline, and recently had to arrange a pick up for a captain arriving as a passenger on a flight from Zurich, with a LX flight number. It took quite a while and lots of hunting to find out whether the flight was actually with Swiss (who operate from LHR T2) or a codeshare with BA (who operate from LHR T4). Thankfully, I arranged for the driver to be at the right terminal for the captain...
I assume if I was slightly confused by this, it must be even worse for those who do not work in the industry!