While applying for PhD in a particular topic, how useful is research in a different (maybe slightly related) topic?
The topics you mention (theoretical and computational aspects of high energy physics) are similar enough that any publication you get from one will be equally valuable when applying for the other. In fact, demonstrating that you have experience of both theoretical and computational work can only make your application stronger than if you had experience in only one.

Bear in mind that having a journal publication is not necessary for admission into any PhD programme that I am aware of (certainly not in UK physics). While a publication in either field that you mention would certainly boost your application, don't worry if nothing publishable comes out of your Master's. Just do good, solid work and ensure you have a strong grasp of the foundations of the field.

If you do write a paper, be sure to do it under the guidance of your Master's supervisor. They will help you organise the content and choose an appropriate journal. Submitting to arXiv is fine as long as you quickly follow it up with submission to (and hopefully acceptance in) a peer-reviewed journal. 

Your supervisor (if they are active in the field) will also be able to advise you on which institutions to apply to for your PhD. When I was deciding where to apply, I mainly looked at the institutions of the authors whose papers I was frequently citing. That at least ensures your research interests will align, which is far more important than any other deciding factor (including perceived prestige of the university).

Source: I am a PhD student in physics in the UK.