fighting a hit and run gorilla war is one thing but defeating a regular and trained army and capturing land is another thing altogether which is way beyond the capacity of Peshmerga, unless it has a support of another regular army.
Iraq is bad example because its military was disbanded by the occupation forces and they left a deeply divided, untrained , ill-disciplined and disloyal Iraqi force that has lost to ISIS. Syria also is unfair example because FSA and ISIS have enjoyed the support of Israel, turkey, West, KSA, UAE etc hence lost some part of the country.
you forgot our east Pakistan (now Bangladesh) the insurgency was supported by Indians and in the end they invaded and beat the Pakistani forces made alien in their own country.
such thing will NEVER ever happen to Turkey because its a NATO country as well and although it wont need help from other NATO country to deal with some Kurdish terrorists but if some Arab Middle eastern country plays with the idea of redoing what its descendants did to Ottoman empire then NATO will also come in force to teach them a lesson.
already the west is fed up with some Arab monarchies for playing the role of AQ and ISIS funding and pretending to be Western "allies" as well