I don't think that's possible, what do you want to accomplish? Do you want to get all threads with its messages? then you can join the second query to the first one.
If you want to take the messages from one or some threads, you can use pluck method to get the thread ids from $threads Collection, convert it to array and use where or whereIn in the second query.
$threadIds = $threads->pluck('id')->toArray();
in the second query just add:
->whereIn('thread_id', $threadIds)