Why does Turkish airlines still fly over Iraq, is it safe?
Flying over conflict zones has been a common practice at all times. However after MH17 was destroyed over Ukraine some changes occurred.

From an overall standpoint, EASA, the safety agency for the European Union, has an active information bulletin dated March 31, 2017, which is the extension of one issued on December 23, 2015:


  Iraq airspace, all altitudes.
  This CZIB applies to operators.
  This CZIB is valid until 30 September 2017
  
  Due to the hazardous security situation, with the presence of
  terrorist organisations and ongoing high intensity military
  operations, there is a risk of both intentional targeting and
  misidentification of civil aircraft. The presence of a wide range of
  ground-to-ground and dedicated anti-aviation weaponry poses a HIGH
  risk to operations at all flight altitudes.
  
  Recommendation(s):
  
  Operators should take this information and any other relevant
  information into account in their own risk assessments, alongside any
  available guidance or directions from their national authority as
  appropriate.


It must be noted that Turkey while not a member of the EU, is still a partner of EASA and Eurocontrol.

On their side, the Iraqi Civil Aviation Authority states the sky over Iraq is safe.

Bottom line, operators have been informed of a high risk, and must evaluate their individual situation based on this warning and all other elements they can get on their own.

As mentioned by EASA, operators must comply with national directives if any. 


For French operators, the situation is clear. DGAC, the national aviation agency has purely and simply forbidden Iraqi airspace (FIR ORBB) since July 2014, in an AIC valid for several conflict zones.
A similar order for Turkey would be issued by DGCA, but I was
not able to find such document.


In addition of Air France, many airlines have stopped flying in Iraqi airspace: press articles mention e.g. KLM and Qantas, Lufthansa and Royal Jordanian, and many other similar information can be found online.

The situation of Turkey is a little bit complex. Their have a southern border with Iraq and Syria, and the Sinai peninsula is also a conflict zone.

  

This may push operators to take more risks than others with southward routes.

About conflict zones, see also: Apart Kenya, what are the current dangerous / unsafe airspaces?