It really depends on your set of requirements. Are you only gonna support 1–1 channels? Or also group chats? Do you need to have different user roles implemented in chat (for example, moderators)?
If you want a basic chat system with a minimal, non-complex set of features, Firebase RTDB will work fine for you. To get most out of it you will need to use it along with Cloud Functions.