I think it's unnatural for Russian speaker to vocalize "д" in "код". We may force this sound sometimes to distinct between these words, but in relaxed speech there is no difference in pronunciation.
In quick speech there may indeed be no difference (in such speech the vocalization most likely depends on the following word). But in slow, distinct speech there is certain difference. Example of pronounciation of "код" in Russian at 1:03 here: Генетический код - YouTube
Well I have just re-analyzed myself and actually I can say that I will vocalize the final "т" in "кот" if it is followed by a voiced consonant. Like in "кот занимался" or "кот добежал". That said the pronunciation of the words may depend on the following word, but separately of any context or at the end of a speech the words would be pronounced differently.
If an English speaker it told to always pronounce "т" even before a voiced consonant he would be sounding very weird. I advise just to forget about this rule as non-constructive and not helping.
Russian Lessons | Russian Tests and Quizzes | Russian Vocabulary |