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: