Yes, threaded messaging with PubNub is possible. A good approach is to use message metadata.
While there isn't an out-of-the-box solution for building threaded messaging, you can create a hierarchy between messages by tagging them with metadata of your choice and maintaining their relationship on your end.
For instance, you can use the time token of the original message sent on a channel as a threading key. Based on that, you can group all corresponding messages and handle their correct ordering in your UI by using each message's time token.
NOTE: Use cases may vary, so if the solution above is not what you are looking for, contact support@pubnub.com.