You can use this code on the checkout page for modifying the default billing country
add_filter( 'default_checkout_billing_country', 'change_default_checkout_country' );
function change_default_checkout_country() {
return 'US'; // country code
}
ANd for modifying default shipping country use this code at the checkout page
function change_set_checkout_field_input_value_default($fields) {
$fields['shipping']['shipping_country']['default'] = 'Australia';
return $fields;
}
add_filter( 'woocommerce_checkout_fields', 'change_set_checkout_field_input_value_default' );