Yes, you can. But you must know very well what you are doing, how your mods will affect the rest of the system, etc.
You might want to begin writing run-time (un)loadable kernel modules to get used to linux kernel programming.
And do your tests in a VM if you don't want your kernel to panic(). Errors at r0 are not allowed.
Btw, what do you want to accomplish?