In your case, the correct sentence is the second one:
She heard a voice that, thank God, she recognized.
The "thank God" part is an aside to say that one should thank God for what happened.
The first sentence isn't grammatically correct, but could be reworked to be in the past tense:
She heard a voice and thanked God that she recognized it.
Any use of "thanked God" like this would be referring to the woman thanking God in the past tense. However, you could modify the subject to refer to yourself as the speaker instead:
She heard a voice, and I thanked God that she recognized it.
This means that you had thanked God in the past for the woman recognizing it.