Disclaimer: I am not sure of the legal position in the UK but in general:if someone wants to get rid of an employee they will most likely find a way
Yes they can. If an employee shows they want to part with their current employer, that impacts on the trusted relationship between the two. There are even jobs where you are escorted out of the building and put on immediate "gardening leave" to not give you an opportunity to steal customers or have a deep insight into the most recent deals. Financial/Insurance sector for example.
It is always bet not to discuss this with your employer until you are ready to hand in your notice.It is always best not to discuss leaving with your employer until you are ready to hand in your notice.
IdI do, sometimes, when I switch roles or get a changed responsibility, ask for a short letter of recommendation - just for keeping in my files to document my development.
Other than that it is customary and expected that you can´t give a reference for your most recent job if you are hired out of an existing engamentengagement.
So TLDR: Depending on the job and the character of the boss, they may try to get rid of you asap, make an counteroffer and try to keep you or react in grace and hope you give a clean handover in return.