It will depend upon state laws as well as insurance companies' guidelines and rating system but where it is allowable insurance carriers do typically include the "garaged" location of the vehicle as one of their rating factors.
In most states where you live helps insurance actuaries assess your risk for accidents. Your Zip Code and its loss history (which includes factors such as your area’s claims history, crime rate, and number of drivers) help determine your auto insurance rate. This explains why drivers in large cities like Los Angeles and New York City have to pay higher auto insurance premiums than drivers in rural areas.
Some states allow zip code rating but only as a secondary factor. For example in California Proposition 103, the sweeping 1988 insurance reform initiative, requires that insurance companies count a motorist's driving safety record, miles driven annually and years of driving experience more than any other factor, including the ZIP-code, when they set auto premiums.
If you live in a large city that comes with large rates there are things you can do other than move. You can discuss discounts with your agent as well as drive safely, avoid auto insurance claims, and shop around for the best rates.