The Terminator's primary objective was to protect John Conner. The T-800 believed that the only way to ensure John's safety was to destroy all technology brought back from the future, including itself.
The plot point being made (as indicated by Sarah Conner's voice-over at the end) is that the Terminator, as a learning machine, was capable of understanding the concept of self-sacrifice and even empathy. If a machine, originally programmed to kill, could learn those concepts, then it should be possible for humanity to learn them as well.
Certainly the advanced AI of the Terminators had some capacity to prioritize orders given new information and new situations. It certainly would have disobeyed John if John ordered the T-800 to not fight the T-1000, since that order would have been in direct conflict with its primary mission.