I am doing masters in physics. I recently did internship in high energy physics for 2 months. But my institute allows me to do 6 months project only in condensed matter physics. I want to pursue PhD in high energy physics only. So, is it possible to pursue PhD in different area than master's thesis?
Of course you can! The specific subfield is mostly limited by (a) your interests; (b) availability of a suitable supervisor who knows that field, and possibly (c) availability of funding/equipment/etc for that research direction. It may be that a particular university/department doesn't accept your chosen direction (e.g. they don't have the researchers or funding for in-depth high energy physics research) and you need to look for other universities to do the PhD, but your master thesis topic is not restricting in any way.
It can be slightly useful to do a PhD that aligns with your master thesis, as it gives you some head start and possibly some publishable research already, but it's not a race and you definitely can do it in a different direction, many people do.
Researchers work in multiple areas
To expand on this - there are few general restrictions. It may be that a particular organization (or funding source) or person at some particular time nudges you do do something specific; but in general, there are no universal restrictions and people can:
I was offered by a couple of institutions to enter a Ph.D. program in Labor Studies or Sociology, even though my existing degrees are in Computer Science. Now, true, I have a PhD, but - this is all possible if you make a reasonable case why you should be admitted.
(That's not to say that university bureaucracies will easily accept such a situation; but you have your PhD advisor to help with that.)