I have seen quite a few apps do this. There is Universal Copy that allows you to copy any text from the currently visible screen. There are apps such as MySmartPrice that overlay a "bubble button" on top of Amazon app, reads the product name and searches for lower priced listings of the same product at other sites.
I understand this is done using Accessibility service on Android. Here are a couple of links discussing this:
Thanks Don. I did see the first link but NotificationListener can only read notifications and not text from another app's Activity. The second link was promising but sadly it didn't reach anywhere.