Cellular phones and VoIP services can be used with any number.
However, landlines must be associated with an area code for the region it is in.
While you can use a California 951 area code for a cellphone or VOIP carrier in New York (as an example), you would need a local New York area code such as 646 for a landline.
Please note: Not every phone number in your area code will work at every address in your area code. This is true of all numbers in the country. If you move outside of your “rate center”, even your current landline number would not work at your new address. It has to do with the legacy telecom switch network. VOIP and wireless carriers are not bound by these restrictions. They use the internet and cell towers, respectively, independent of the telecom switch network.
Please contact your landline carrier first and ask them if the number you are interested in will work at the physical address you want your phone number to work at before ordering or buying your new phone number.