Hi
Your licence will be issued by the country where you got your Class 1... so, yes, you can train in Portugal and then get your UK licence. All the ATO has to do is file your licence in the UK.
In practical terms this could cause some delays to obtain your licence but it can be done.
I run an ATO in Spain and we have similar queries form people from the UK, Ireland...
Also note that you can transfer your licence... Ryanari and easyJet demand you to transfer your lincences to Ireland and the UK when working for them...
Hope it helps
Cheers
Alex