I don’t see why you couldnt do it. How you do it depends on how you are getting your sms service. I’ve used Zipwhip (sms provider) to call their send text API in the dialplan via system.
Anyway you cut it, I would imagine you would need to add some custom code to your dialplan to accomplish this.