There is a significant difference between the UK and Hong Kong.
In the UK, there is no register of legal names. A deed of change of name ("deed poll") is simply a piece of paper on which you've written a formal declaration written on it that you're using a new name. See here: https://www.gov.uk/change-name-deed-poll
You can submit that declaration as proof of change of name when applying for a replacement British passport in the new name.
Hong Kong visas are issued to the person, not the passport. So the visa will remain valid even if you get a new passport (even in a different name). To prove your status, simply present BOTH the old (cancelled) passport in the old name AND the new passport in the new name.
(Note this can cause some confusion, because your new British passport will contain NO reference to the old name, contrary to the expectations of some Hong Kong officials. Hopefully, your photographs are sufficiently similar to make it really clear you're the same person – and obviously the birth date will remain the same)
You can then apply to the immigration department for the visa endorsement to be transferred to the new passport.
You should also get your ID card name changed to match the new passport, by submitting form ROP73: https://www.immd.gov.hk/pdforms/rop73.pdf
Hope this helps!