No - or at least not enough to make the cookie dough safe. While cooking can kill a lot of different bacterias, it may not kill all the bacteria that grows on spoiled food. Many types of bacteria, such as botulism, can create heat-resistant toxins. So, unfortunately, even a baked cookie can be a vector for foodborne illness.