In order to answer this question properly I need to point out that bacteria, per se, (even the nasty ones) aren't directly the cause of food poisoning. It's the toxic waste products produced by those nasty bacteria which can cause problems.
If milk is pasteurised in the dairy, as soon as it comes from the cows or goats, any bacteria should be killed before they can produce any nasty waste products. If the same milk is put through exactly the same process at a later time, some bacterial growth will have occurred, with a greater risk of toxins being formed. (The rate of bacterial growth will depend upon the level of refrigeration used).
The heat from your oven will kill the vast majority of bacteria in the milk but it won't destroy any toxins which have already been formed. However most healthy people can consume unpasteurised milk anyway, with a negligible risk to health. It's only people with immune systems which are not properly developed (as in young children) or deficient (as in some elderly people, and those with HIV or other diseases which attack the immune system) that need to worry about unpasteurised milk products. That's why it's perfectly legal to sell products made from unpasteurised milk (as Waitrose do, with their excellent Keen's cheddar).
Chris