On an iPhone you can!
Recover deleted messages on iPhone
In Messages on iPhone, recover deleted text messages and entire conversations.support.apple.com
I'm no techie but I do know on my Android if I delete a message it goes to trash where it will stay for 30 days unless I "empty" the trash. Same for images. Also have the option to restore. They are probably still there after deleting in the unallocated space and retrievable via software or your phone provider like we see in a lot of investigations. Works the same for a Google gmail account also.