Turkish military launched an operation on Syria, occupied lands which are getting bigger so far and regularly striking targets in north Iraq plus is has bases in booth countries, you might overthink your analysis considering those facts.
If anything, all you have to do is look at my countries invasion and subsequent occupation of Iraq and Afghanistan. We came in with the strongest military in the world, kicked everyone's *** in 3 or so weeks and then since we were both hated and our domestic influence was small, the people resisted us.
And Iraq is where it is today.
But Iran took that chance since the religion, that being Shia islam was the same as the majority of Iraq, and made Iraq into a rather strong Iranian ally (around millions or 500,000 Iraq Shia fighters are loyal to Iran if I'm not mistaken). Syria is no different but the ties between the two countries aren't so much religious as they are strategic and ptactical.
But the main point of Iran not allowing Syria to be divided up and the Bashar government to be disposed is by all means Hezbollah. Hezbollah is no longer a highly trained militia with the aim of protecting Southern Lebanon, it's much stronger and way better equipped. With its soldiers being some of the best and highly trained of the militias and militant groups in the world (track record is amazing as far as battlefield wins are concerned).
Russia recognizes Hezbollah power and Iran has many other groups that it is training that follows Hezbollahs model.
Hezbollah keeps Israel in check and that's saying something.
I do have a quick few things on Turkey though. I like the country and the people (I am American but both of my parents are Iranian, and I was born in the US).
But frankly Turkey should have never took the US stance with regards to Syria. As strong as Turkey is, Turkey is still no US military not even close. Defense budget and multary equipment aside, I don't think the Turkish people let alone government would actual welcome a prolonged war against Iran in both Syria and Iraq. Sonce Turkeys internal security is abysmal by all a counts and a coup attempt etc, etc...
Before I go on, I mean no disrespect to the dead Turkish civilians and soldiers who have goven their lives in their fight against terrorist (Turkey is very stead fast in spirit when it comes to this regard).
But Erdogan made a mistake, Turkey just has a strong militany compared to the countries around it but comparing Turkish military to Iranian is apples to beef (theyre completely different). What turkey lacks is influence just like what the US lacked and ultimately will lose of they go it alone.
Lucky for Turkey, Erdogan sees his error and is working with the Russian Syrian Iranian alliance. This will pay off better for turkey as the US is just a burden for Turkey and it's people.
You guys can't take much more terrorist attacks. I'd that happen then your entire country will be on the path to a failed state and turist will refuse to come from the fear of bwing shot up or blown to pieces by the 1000s of Islamic extremist that live in turkey (as a result of idiotic government policies regarding Travel of people from turkey into syria)
To tell you all the truth. Iran has the best security in that region bar none. It really amazes me.