It depends on the processor and motherboard. You can't put a newer version Intel or AMD processor into an older version motherboard for example.
Changing the processor is quite a bit more difficult than changing RAM. The procedure is slightly different for different processors so again, I'd need more information to help you further.