I guess the idea behind Sollozzo's plan in The Godfather was that Sonny would become the leader and then go into business with him. But two big flaws: Sonny clearly wasn't going to do so and the other thing is, Sollozzo wanted Vito's political/judicial influence which there is no indication Sonny would have inherited. If Vito had planned to impede Sollozzo from pursuing the H trade, sure, it might make sense but otherwise, it was crazy and BTW, it sure did not work.
Sollozzo didn't know Sonny well enough to understand that he was a hothead. There two things underpinning his assassination attempt of the Don:
- He thought Sonny was interested in selling heroin when he spoke up at the meeting, and might welcome taking over the family business from his father to engage in this lucrative trade.
"Sonny was hot for my deal, wasn't he? And you knew it was the right thing to do."
- He viewed bloodshed as too expensive, and thought Sonny would react rationally before taking on the expense of a war. He tells Tom as much after he kidnaps him...
"I don't like violence, Tom. I'm a businessman; blood is a big expense."
So, yes, knowing what we know about Sonny, these are horrible assumptions. But to Sollozzo, if either 1 or 2 were true, he'd have a deal once the Don was out of the way. He probably calculated there would be some loss of political influence, but decided that cost was worth being able to start the business.
"That'll be his first reaction, sure. That's why you gotta talk some sense into him. The Tattaglia family is behind me with all their people. The other New York Families will go along with anything that will prevent a full-scale war. Let's face it, Tom, and all due respect, the Don, rest in peace, was -- slippin'. Ten years ago, could I have gotten to him? Well now, he's dead. He's dead, Tom, and nothing can bring him back. So you gotta talk to Sonny, you gotta talk to the caporegimes, that Tessio and that Fat Clemenza. It's good business, Tom." - from Movie Quote DB
The rational thing for Sonny to do was make peace, but Sonny was not a rational person.