Create Taxonomy vocabularies and terms in installation profile
'Terms' are data, so you must import them using the Migrate module or Feeds module.

It's easy to create 'vocabularies', not programmatically but using a Feature and then enable it with you installation profile. 

But if you want programmatically here is a good article that describes how to create Taxonomies vocabularies and terms programmatically.