https://ask.usda.gov/s/article/Can-you-get-botulism-from-gar...
https://ask.usda.gov/s/article/Can-you-get-botulism-from-gar...
The only way to kill the bacteria is to cook it at an extremely high temperature/pressure, which I believe cannot be created by home cooks (certainly not on the stove).
Store-bought garlic jars are treated to be safe, though I don't know if they can become contaminated when you open them and leave them out on the counter. My guess is this is probably not common, otherwise it would happen with all sorts of food that is stored in oil and kept for long periods of time in the fridge.
> stored in the refrigerator at 40 °F or lower for no more than 7 days
At temperatures above 38°, the toxin can be produced, and no amount of cooking will make it safe to eat.