I know that you can create community sites based on a pre-packaged template (Kokua, Koa, Napili, Aloha) or just create a visualforce-based community. For the pre-packaged templates, is there a way to put your own buttons and visualforce code in these templates, or are you limited to customizing these based off what's offered in the community builder only?
You can not use Visualforce code in these templates. So themes like (Kokua, Koa, Napili, Aloha) templates let you quickly and easily build a self-service community that gives customer the same visual and functional customer experience weather they use tablet or mobile.
As per documentation :
Community Builder makes it super easy to customize your community. Simply edit a few of the components to include information about your community, add a few images to extend your branding, and you’re ready to go without any coding! Additionally.
if you want a more customer experience, you can create custom pages, add components to pages, use custom Lightning components, and expose additional Salesforce objects.