Sometimes. If you have a name brand computer you should be able to find out what CPUs it supports on the company's support website. If you have a "white box" computer find out what brand and model of mother board your computer has and look up what faster processors it supports. Also consider heat; if you have a very compact case it may not have enough ventilation or room for large enough a heat sink to get rid of the extra heat a faster CPU or one with more cores generates.
If you are talking about computers, yes you can but make sure is compatible with the motherboard.
few processors supports over clocking