The below opinions could primarily apply true to right handed people
The primary goal in any chat/conversational interface (digital or even art) is to differentiate between the two parties. Conversation happens in real life between two or more entities (well, even self chatter banks on duality I would say;)),and the purpose of the interface would be to facilitate that depth/space to mirror our mental model of separation or the feeling of being different individuals. Separation also helps in easy scanning of the entire conversation.
- Let's go back in time and trace the original inspiration behind the chat/conversational interfaces we have today. Best and closes example, in my honest opinion, that capture conversations are the Comic strips.
These comic strips have a big cultural imprint and we associate with them. In most of these, you will find the "question" or the "initiator" to be on the left side and the "response" marked towards the right. Question, here can be compared a incoming message vs the response which is the outgoing message. Hence the right alignment of the outgoing message, which is the user himself/herself.
Flow & Cause/Effect - A conversation is perceived as a progressive action. It builds on the last message. So assuming the person on the other side said something, putting the user's message on the right satisfies a mental model that the conversation is moving ahead. Also, since the Send button is generally positioned to the right most, the effect of using it, which is the user message, appears closer to the point of cause, when placed right.
Eye tracking patterns - If we look into the Gestalt's and 'Z' eye pattern research, both suggest the exit points towards the lower right. The entry being the top left. Hence the notion of incoming message (left) and outgoing message(right) gets established/recognised mentally.
Also, without any research backing me, to a right handed person, things towards the right in a boxed environment seem closer to self, and hence right UI alignments mimics that to help us perceive those messages as ours. Gut feeling speaking :)
Sources of images: