Yes, it may be possible to buy, register and insure a car in one state while holding a driver's license in a different state. There would need to be a good reason to be doing so. A common example is if you're going to school out of state, where you want to buy, register and insure a car, but you want to keep your license from your home state. Military members stationed outside their home state, or people keeping a car at an out-of-state vacation home may also want to own a car in one state and have a license from the other.
If want to buy, register and insure a car in one state, but drive it in your home state where your driver's license was issued, you may run into trouble. State laws usually require you to register and plate your vehicle in the state where the car will be primary driven, especially if you are a resident of that state.
Insurance companies are similar since they also normally require you to insure your vehicle in the state where the car will be driven and garaged for the majority of the year. This means typically one should buy insurance in the state that your car is registered since that is, in a normal situation, where your car will be located, driven and garaged.