In Mendix you can build all the logic you want (in combination with Java), but the question is should you build it from scratch in Mendix or use third party solution(s) which are probably more complete like Dialogflow, Wit.AI, Intercom etc. Assuming you considered that extensively, you can set up like this;
1 – build a chat mechanism to send/receive messages, you can use a microflow timer to retrieve messages and show it in a custom list view, mimicing a chat conversation. be carefull with performance costs. or use a third party solution like
2 – build logic to support dialogs for chat with intents,entities, patterns, for more info you can have a look at; https://teamtreehouse.com/library/intents-entities-and-dialogs
From experience I can advise you the quickest, cheapest, good solution; wit.ai less complicated, easy to integrate and free.