@GeoffreyG First, you can't just generally lump W2 and 1099-MISC together. Your statement "you would not need to file taxes in that other state unless you actually (physically) worked there." is incorrect and an overgeneralization. If the company doesn't have an established business presence in the state where you're working, you may be subject to taxes from the income-source state. This would mainly be a concern in the case of being issued a 1099-MISC from out-of-state and moreso for sole-proprietors (independent contractors, business owners, etc). A W2 employer in your state that you work for would have established a physical business presence there, setup withholdings, etc. in that state., and that's why you typically file your personal tax returns in that state. You have income sourced from that state even though the parent company resides elsewhere. They established nexus in that state. It would take a competent tax professional to appropriately evaluate the situation to determine the best course of action.
Payroll office location would never come into play as that doesn't concern source-income.