Can I use hooks in a template for views?
The API reference at http://drupalcontrib.org/api/drupal has all of the Views hook in it: http://drupalcontrib.org/api/drupal/contributions--views--docs--docs.php/group/views_hooks/6

That said, the views documentation is a little sparse.  The best thing to do is look through the list of hooks, then search on the various hook names for examples.

I suspect you need to use hook_views_query_alter but I don't think I have ever had to add a JOIN to a view before.

EDIT:

Notice another of your questions: Join a custom table on a View.

In your case, if you want to properly make a custom table Views aware, implementing hook_views_data is the correct solution.  But you still need to do this in a custom module, and not in your theme files.