Texting while driving can be extremely dangerous, but replying to messages with your voice is probably the safest way to do it. I've used Google Now (well, it's not called Now anymore) on my Nexus 5X countless times to send SMS and Hangouts messages while driving. Facebook today announced that the Facebook Messenger application for Android has added support for Android Auto.
As you might imagine, this allows users to send messages with voice commands, as well as have your car read messages aloud. Messenger also provides a button on the notification to automatically reply "I'm driving right now." If you have a compatible Auto unit (or use your phone as the head unit), everything should work without issues.