Certainly one can add a rating (IR, MEP, TR,…) to a license issued by EASA country „A“ by taking a course at an ATO in EASA country „B“.
Is this also true for upgrading the license itself, i.e. can someone with a PPL issued by „A“ take a CPL-course in „B“ and get a CPL from „A“ straight away?
Yes.
If the examiner is from the country A, then generally yes with no conditions. Examiners from the country B need to be approved by country A’s CAA in advance of the skill test.
Now with the Examiner Differences Document [ local copy ] I would say that the examiner does not need to be approved but there might be certain conditions depending on which the licensing authority(country A) is.
Thanks for your answers. And the written test (e.g. ATPL theory) can also be taken at CAA “B” for an “A” license?