Generally you can update to whatever was available at the time the laptop was made.
If that exact laptop model also came with an i5-xxxx and a i7-xxxx, then the bios, the cooling, etc is usually able to handle those chips.
If the fastest that laptop came with was an i5, the thermal cooling and bio probably can't handle the i7 and it won't even boot if the bios doesn't support it.