Retired Agent and Broker, Self Employed, Albany NY USA
Sure you can. Let's say you live in NY (your legal address) and have a vehicle registered in NY. You can purchase NY Personal Auto Insurance in any state where the agent/broker is licensed in/for NY anmd represents a carrier that is licensed in NY to sell NY PAP and will accep[ NY business from the agent or broker. I haven't purchased insurance online, but I would guess the online site asks for your information including state of registration, legal address, etc. If you purchase online you are acting as your own insurance broker (lots of luck unless you are a student of insurance...)
Another situation is if you are a legal resident of NY and have a seasonal home in Florida. You desire to have a car in Florida and wish to insure it in Florida. I would recommend checking with a Florida agent or broker how to do this. (Insurance is regulated by state - there is not a countrywide standard.) Many insurance carriers require you be a legal resident of the state to purchase auto insurance for that state. Some may let you obtain a Florida registration and plate and issue you a Florida auto insurance policy using either your NY legal address or your Florida seasonal address. No 'one answer fits all' for this question. Checking with the state's DMV is also required to find out their criteria for registration application.
Another situation is if you are a legal resident of NY and have a seasonal home in Florida. You desire to have a car in Florida and wish to insure it in Florida. I would recommend checking with a Florida agent or broker how to do this. (Insurance is regulated by state - there is not a countrywide standard.) Many insurance carriers require you be a legal resident of the state to purchase auto insurance for that state. Some may let you obtain a Florida registration and plate and issue you a Florida auto insurance policy using either your NY legal address or your Florida seasonal address. No 'one answer fits all' for this question. Checking with the state's DMV is also required to find out their criteria for registration application.