Allegri didn't ruin him. Dybala is essentially the same player he always was. Allegri tried desperately to fit him into the team but it didn't work. I don't think Dybala quit on the team.
Now the question is whether he was right to prefer Mandzukic over Dybala as a #9, and whether it was more in our long-term interest to try and work Dybala as much as possible into that position, as it appears to be the only position he can play effectively.
It was basically Mario vs. Dybala in the end.