Can training for an Instrument Rating be applied towards a commercial pilot certificate?
Short answer: yes, if the training has been logged with the remark that it meets the requirements of both 61.129 and 61.65.

This topic became confusing because of an FAA interpretation that says:


  [...] are the requirements of 14 C.F.R. §61.129(c)(3)(i)
  [commercial certificate] met by the student getting an instrument
  rating or training for an instrument rating? The answer is no. The
  training giving to satisfy the instrument training aeronautical
  experience of §61.129(c)(3)(i) may also be used to count towards the
  aeronautical experience of §61.65(e) [instrument rating], but the
  opposite is not true. The reason for this is that the training
  required under §61.65(e) is general, while the training under
  §61.129(c)(3)(i) lists very specific operations that must be
  accomplished to satisfy the requirements.


But that interpretation was surprising to many people because it implied that a commercial certificate requires additional instrument training, even if you already hold an instrument rating. So AOPA requested a clarification (more information here); you can read the whole thing, but the key statement from the FAA is this:


  We are merely clarifying the requirement that the applicant for a
  commercial pilot certificate provide evidence that they have met the
  requirements of §61.129. There is not an exact equivalence between the
  training required for an instrument rating under §61.65 and the
  aeronautical experience requirements under §61.129.


Practically speaking (as the AOPA article explains) that means that your CFII should explicitly log the training as covering both requirements:


  [AOPA] urges instrument pilot applicants and flight instructors to be sure
  that instrument training is clearly logged to indicate that the
  training given meets the requirements of 14 CFR 61.65 as well as those
  of 14 CFR 61.129. That would avoid questions about the training’s
  applicability should the pilot one day advance to training for a
  commercial pilot certificate.