Delete database tables on theme uninstall?

Yes, you can accomplish it by WP default functionality. Let me explain it.

1. While switch theme:

There is a switch_theme action that runs right after the theme is switched. switch_theme is triggered when the blog’s theme is changed. Specifically, it fires after the theme has been switched but before the next request. Theme developers should use this hook to do things when their theme is deactivated.

<?php add_action('switch_theme', 'theme_deactivation_function'); ?> 

Theme functions attached to this hook are only triggered in the theme being deactivated. To do things when your theme is activated, use after_switch_theme.

Delete a theme’s options after deactivation:

add_action('switch_theme', 'mytheme_setup_options');

function mytheme_setup_options () {
  delete_option('mytheme_enable_features');
  delete_option('mytheme_enable_catalog');
}

switch_theme will only be called when your theme is de-activated.

2. After switch theme:

Theme functions attached to this hook are only triggered in the theme (and/or child theme) being activated. To do things when your theme is deactivated, use switch_theme.

In other words, the after_setup_theme represents the point at which WordPress sets up the current Theme, not the point at which the administrator activates and/or configures the current Theme.

<?php add_action("after_switch_theme", "mytheme_do_something"); ?>

Add options for your theme and set them to their default values:

add_action('after_switch_theme', 'mytheme_setup_options');

function mytheme_setup_options () {
  add_option('mytheme_enable_catalog', 0);
  add_option('mytheme_enable_features', 0);
}

after_switch_theme only fire when your theme is being activated.

Referance: switch_theme and after_switch_theme actions hook are located in wp-includes/theme.php