There's a few options actually.
You could extend the controller responsible for creating a new thread.
You can usually identify the controller by looking at the URL:
http://xenforo.com/community/forums/xenforo-development-discussions.34/create-thread
XenForo URLs are usually split into a few parts. The first is the board URL (
http://xenforo.com/community) then the route (forums), then the data (forum name . forum ID in the above example) then the action (create-thread).
So you can tell by looking at the URL that you will probably be looking to alter:
library/XenForo/ControllerPublic/Forum.php
In there you will find a public function called actionCreateThread. That, at least, is the code that renders the view for creating a new thread (so before the thread is created). If you want to do something after the thread is created you will need the actionAddThread. (This is the form action, if you look at the source of the Create Thread page, you will see the form action is forum/add-thread).
So, ultimately you will be wanting to extend that controller action.
Another alternative is to look at the DataWriter.
The add-thread controller action instantiates the Thread DataWriter and the Post Data Writer. This interacts with the database and inserts the thread in the database.
All DataWriters have a pre and postSave function that you can extend. The postSave function can be useful because by this point, the thread has definitely been created, and you have access to things such as the thread ID and first post ID which you wouldn't necessarily be able to get very easily from the Controller.
With all this in mind, you will be looking to play with either the load_class_controller event or load_class_datawriter event