Typically, when making purchases online, especially for high-value items like an iPhone from the Apple Store, the billing address needs to match the address associated with the payment method being used. The billing address is used for verification purposes to prevent fraudulent transactions.
If you're using a non-U.S. billing address with a U.S. shipping address, it might pose challenges during the checkout process, as the system often requires the billing address to match the country of the issued payment method.
Sales tax in the United States is indeed calculated based on the location of the purchase, which includes the billing address. Each state in the U.S. has its own sales tax rates, and sometimes there are additional local taxes within states.
If your billing address is outside the U.S. but you're shipping the item within the U.S., the sales tax calculation might become more complex.
In most cases, the system will attempt to calculate sales tax based on the shipping address, which is within the U.S. This means it should apply the sales tax rate corresponding to the shipping address.