If it's the same chemistry (i.e. li-ion), same formfactor (i.e. 18650), and capable of at least as much current as the OEM cell, yes*.
*HOWEVER, it looks like the TH10 does USB charging, which can involve a nonstandard cell and may not work with the inbuilt USB charger or at all if the power contact arrangement is markedly different on the cell than standard.
A quick search of listing images for Thrunite suggest that their 3100mAH cells are standard IMR 18650s. Can't speak to the current demands of your headlamp although a back-of-the-napkin calculation suggests that a 100 lm/W LED at 2100lm would need 21W / 3.6 = 5.83 A / 3.1Ah = ~1.89C peak discharge, something pretty much any quality retail 18650 should be able to provide.