The shortest answer is: You can't avoid being part of such self centered conversation. You will find people who are self-centered, full of ego and attention hungry everywhere. I have seen them so many times in my professional life that I can't imagine a world without such people.
However, I do want to add that contrary to what you feel about this, these people don't get indulge in such self-centered talks on a purpose. There has been no attempt to manipulate the group by them in most of the cases. The real cause is that these people have a very limited and narrow self-centered sense of the world, and they can't speak much about any other topic than about themselves.
So the first thing to do is to accept that you can't avoid such people who are not ableunable to stop talking about themselves only.
Another thing that I have observed about such conversation is that they normally get started in a group of more than 4 people at least. If there are less than 4 people, having such self-centered conversationconversations is a bit difficult. So, if you are in a large group where such a person is present, the best thing is to do is start an independent conversation with a different person who is sitting closest to youclose by. This way, you will create a parallel stream of conversation which has the potential to get other people involved in it. This will break the solo commentary of the self-centered guyperson.
Thirdly, please understand that just like you, majority of other people also do not like such guyspeople. They may listen to their ego driven stories but seldom or never they get impressed by them. As a psychological tacticstactic, it is an extremely bad strategy to only talk about yourself. There is no psychological gain in it. So, don't take such person seriouslypeople seriously as they are not gaining any advantage from such behavior.