You can do an initial EASA Class 1 medical at ANY EASA certified Aeromedical Centre in ANY Country and AT THAT TIME choose the EASA State of Licence Issue (SOLI) you want to get your licence from.
Once you have had your first EASA Medical and have chosen your SOLI that will be your SOLI and they will issue your licence once you have done the required training and exams.
You can, in principle, do your training at any EASA training facility in any country but there is quite a bit of admin hassle involved.
It is possible to change your SOLI, many UK pilots did so prior to Brexit.