This answer is based on A Storm of Sword and A Feast for Crows, so it will contain spoilers
The fight between Oberyn and Gregor was not part of Tywin's plan, however it was out of his control. As the mother of Joffrey, it was Cersei who chose Gregor as champion. Additionally, Tywin didn't know that Oberyn would volunteer as Tyrion's champion. So the whole fight was out of his hands. Tywin (and everybody else) was surprised that Oberyn volunteered as Tyrion's champion. Nobody thought that somebody, especially a Prince, would volunteer to fight the Mountain, particularly to save Tyrion.
[A Storm of Swords:Fire and Gold Spoilers]
It was Mace Tyrell who turned to Tyrion and asked the question. “Do
you have a champion to defend your innocence?”
“He does, my lord.” Prince Oberyn of Dorne rose to his feet. “The
dwarf has quite convinced me.”
The uproar was deafening. Tyrion took especial pleasure in the sudden
doubt he glimpsed in Cersei’s eyes. It took a hundred gold cloaks
pounding the butts of their spears against the floor to quiet the
throne room again. By then Lord Tywin Lannister had recovered himself.
“Let the issue be decided on the morrow,” he declared in iron tones.
“I wash my hands of it.” He gave his dwarf son a cold angry look, then
strode from the hall, out the king’s door behind the Iron Throne, his
brother Kevan at his side.
...
No matter what happened, Tyrion had the satisfaction of knowing that
he’d kicked Lord Tywin’s plans to splinters. If Prince Oberyn won, it
would further inflame Highgarden against the Dornish; Mace Tyrell
would see the man who crippled his son helping the dwarf who almost
poisoned his daughter to escape his rightful punishment. And if the
Mountain triumphed, Doran Martell might well demand to know why his
brother had been served with death instead of the justice Tyrion had
promised him. Dorne might crown Myrcella after all. It was almost
worth dying to know all the trouble he’d made.
We learn before the fight that Tywin was planning on lying to Oberyn, and saying that it was Amory Lorch, not Gregor, who killed Elia and her children.
[A Storm of Swords:Fire and Gold Spoilers]
“And when Oberyn demands the justice he’s come for?”
“I will tell him that Ser Amory Lorch killed Elia and her children,”
Lord Tywin said calmly. “So will you, if he asks.”
“Ser Amory Lorch is dead,” Tyrion said flatly.
“Precisely. Vargo Hoat had Ser Amory torn apart by a bear after the
fall of Harrenhal. That ought to be sufficiently grisly to appease
even Oberyn Martell.”
“You may call that justice...
“It is justice. It was Ser Amory who brought me the girl’s body, if
you must know. He found her hiding under her father’s bed, as if she
believed Rhaegar could still protect her. Princess Elia and the babe
were in the nursery a floor below.”
“Well, it’s a tale, and Ser Amory’s not like to deny it. What will you
tell Oberyn when he asks who gave Lorch his orders?”
“Ser Amory acted on his own in the hope of winning favor from the new
king. Robert’s hatred for Rhaegar was scarcely a secret.”
~ A Storm of Swords
However Tyrion later reveals the truth to Oberyn (or part of it).
[A Storm of Swords:Fire and Gold Spoilers]
“I am not lying. Ser Amory dragged Princess Rhaenys out from under her father’s bed and stabbed her to death. He had some men-at-arms with him, but I do not know their names.” He leaned forward. “It was Ser Gregor Clegane who smashed Prince Aegon’s head against a wall and raped your sister Elia with his blood and brains still on his hands.”
“What is this, now? Truth, from a Lannister?” Oberyn smiled coldly. “Your father gave the commands, yes?”
“No.” He spoke the lie without hesitation, and never stopped to ask himself why he should.
Following the fight between Gregor and Oberyn, as Gregor is dying, and confessed during the fight, Tywin plans on giving him to the Martells. He tries to get Pycelle to save him, so that he can deliver him to the Martells alive.
[A Storm of Swords:Fire and Gold Spoilers]
“Then I fear Ser Gregor may die.”
“Undoubtedly. I swore as much in the letter I sent to Prince Doran
with his brother’s body. But it must be seen to be the sword of the
King’s justice that slays him, not a poisoned spear. Heal him.”
However when it is clear he is going to die, delivering his head suffices.
[A Feast for Crows spoilers]
When he dies, bring me his head. My father promised it to Dorne. Prince Doran would no doubt prefer to kill Gregor himself, but we all must suffer disappointments in this life.
~Cersei to Qyburn (who is treating Gregor) in A Feast For Crows
[A Feast for Crows spoilers]
“His long wait is almost done. I am sending Balon Swann to Sunspear,
to deliver him the head of Gregor Clegane.” Ser Balon would have
another task as well, but that part was best left unsaid.
“Ah.” Ser Harys Swyft fumbled at his funny little beard with thumb and
forefinger. “He is dead then? Ser Gregor?”
“I would think so, my lord,” Aurane Waters said dryly. “I am told that
removing the head from the body is often mortal.”