To give some specific background, the US-UK tax treaty specifically protects rollovers between qualifying retirement plans in one country from taxation in the other one. This of course assumes it is treated as a rollover and not a withdrawal, so nun's advice about following the rollover rules correctly is very good.
Also consider the possibility of transferring your 401k into a Roth IRA rather than a traditional IRA in order to protect your retirement money from UK taxation. Withdrawals from a traditional IRA are subject to UK income tax if retiring in the UK, but withdrawals from Roth accounts are both US and UK tax free. The crucial point here is that HMRC does not tax Roth conversions (owing to the above mentioned treaty language) which means that you can escape UK tax completely. You'll pay the usual US tax on the Roth conversion, but then you'll be free and clear.
Depending on the size of your account, it might also work out to transfer the 401k to a traditional IRA now and then do a series of partial Roth conversions over multiple years. This may be better tax planning anyway so that the conversion amounts don't push you into a higher US tax bracket. Just be sure to convert before you take the money out.
Hope this helps.