If it is attached to something else, it is regarded as on something, so you cut it off, on and off being opposites. Once a thing is cut off, something remains that it used to be attached to.
The head is on the body, so "Cut off his head!" (The body remains.)
If it is on the inside of something else, it is regarded as in something, so you