Is it possible to export topic post data to csv?

Yes, you can export the query result to a CSV file. You have a button for that action:

I’m not entirely certain if this is precisely what you had in mind, but I can provide you with a starting point. You provide a topic ID and the post number you want to get all replies from:

-- [params]
-- integer :topic_id
-- integer :post_number

SELECT u.id,
       u.username,
       p.raw,
       p.cooked
FROM topics t
JOIN posts p ON t.id = p.topic_id
JOIN users u ON p.user_id = u.id
WHERE t.id = :topic_id
  AND p.reply_to_post_number = :post_number
  AND p.hidden_at IS NULL
  AND p.deleted_at IS NULL

This looks like this: