A civil aircraft must have a Certificate of Airworthiness to enable it to fly. Foreign aircraft can fly in another country's airspace only if they have a valid Certificate. Leased aircraft often retain the registration of their original owner, whether it be a leasing company or an overseas airline.
Here in the UK we've had the situation of cargo companies operating Russian aircraft (Antonov 124s and Ilyusin Il-76s mainly) and these aircraft having to retain their Russian registrations, even if they were painted up in the full colours of the British operator. This is entirely down to the fact that these aircraft have not been tested by the UK certification authority (the CAA) and are therfore not eligible to carry a UK registration.
Manufacturers retain ownership of their aircraft until formal hand over contracts have been signed. That is why they carry the national ID
of the manufacturing companies until formal hand over.