The Terminator was initially programmed to follow John Connor's orders with the explicit remit of keeping John safe from harm ("My mission is to protect you") unless ordered otherwise (“You have to do what I say?” “That is one of the mission parameters.”).
When John placed the Terminator's CPU into read/write mode, he created a situation where the machine was able to start thinking for itself and becoming self-aware, something that Skynet was evidently against.
By the end, it's clear from both the script and screenplay that the Terminator has begun to exceed its initial programming. It has gained an awareness of human emotion (and in the novelisation begun to have outright feelings) and has realised that its continued existence puts John at greater threat. On top of that, it openly ignores its own primary directive by disobeying a direct order from John not to allow itself to be destroyed.
It appears that the proscription from self-termination is hardwired into the Terminator in a way that can't be immediately overwritten but that there's nothing to stop it from allowing itself to be terminated, especially given that doing so will enable it to keep John safe.
Note that in each of the novelisation, the original screenplay and the finalised shooting script, the terminator does self-terminate, throwing itself into the molten steel. The line about not being able to kill itself (and the scene where the Terminator is lowered into the steel) seem to have been inserted later on.
Script
SARAH : Are you afraid?
TERMINATOR : Yes.
He turns and steps off the edge. They watch him sink into the lava. He
disappears... the metal hand sinking last... at the last second it
forms into a fist with the thumb extended... a final thumbs up. Then
it is gone. Terminator Shooting Script Rev.
2
Frakes Novel
“No. There was another chip.”
He touched a metal finger to the side of his head.
Terminator looked at Sarah. They both knew what must be done.
John’s eyes went wide as he suddenly understood what he meant. He shook his head as his eyes began to fill with tears.
“No!”
Terminator faced John. A hideous visage, with all the punishment it
had taken, but somehow noble ...kind.
The man/machine said, “I have to go away, John.
It must end here ... or I am the future.” It turned a little so that
the battered human side of his face was in shadow. John saw the chrome
skull and the red eye.
Still, John pleaded, “Don’t do it. Please ... it’ll be okay. Stay with
us—”
Terminator put his hand on John’s shoulder. “I must complete my
mission.” And as he said that, the human side of his face came back
into the light. He reached toward John and his metal finger touched
the tear trickling down his cheek.
It was the revelation.
“I know now why you cry, although it is something I can never do.”
He turned to Sarah and said, “Good-bye.”
“Are you afraid?”
There was the briefest instant before he responded.
“Yes,” he said. Not because he was going to cease functioning as a
terminator, but because he had sensed a vision beyond his programming
of a cosmic order vast beyond even Skynet’s comprehension. And it gave
him the sense of his first feeling.
Fear.
Of where he was going next, if anywhere.
Of course, he hadn’t been asked for further details on his answer, so
he didn’t say any of this. He simply turned and stepped off the edge.
As Terminator fell, time stretched, and a flash of light engulfed his
mind. He was floating down a tunnel, following the flash of light into
something like oblivion.
Or salvation.
The artificial brain was seared when the chassis hit the molten steel.
Almost all electrical activity was stopped.