Could I upgrade my laptop processor from Intel i3-4030U to Intel i7-4510U?

Could I do that? Also, is any CPU with the same socket compatible?

Added (1). Could I upgrade my Lenovo Flex 2-15 processor from Intel i3-4030U to Intel i7-4510U?

No, laptop processors aren't upgradeable, even if the sockets are compatible. That's because the laptop processors' sockets are soldered on, you can't remove it without destroying it, or using special equipment.