You can. Even if the bacteria that's been cultured is a harmless one, if the petri dish has been contaminated with a pathogenic one (because the person who made it wasn't following the procedures to keep it sterile properly and they happened to have small numbers of pathogenic organisms on their hands, in their nose/throat etc* which got on the petri dish before incubation,) then you'd accidentally be growing pathogens.
*many people carry these without becoming ill themselves. Some of them can cause really nasty infections, including meningitis.
I used to teach science, including doing microbiology practicals with kids. Under the health and safety regulations we weren't allowed to incubate anything at 30-40 degrees C in case some kid sneezed on it or something (bacteria that thrive well at those temperatures will thrive in the human body - I can't remember the exact temperature range that was forbidden it may have gone right up to 60 degrees) - 20 C was the recommended temperature (if it's too cold it'll grow too slowly). Also, we weren't allowed to culture anything that came from the kids, especially not their nose, throat etc. Ordinary dirt, e.g from a classroom floor or desk, was fine. Meningitis was the usual reason quoted. But there are other like Staphylococcus aureus can be problematic. Also, petri dishes were sellotaped closed before incubation (in a loose, x pattern, so oxygen could get in... don't want to be growing anaerobes in the classroom!!) and kids were strictly forbidden from opening them up again after they get them back. This prevents kids from doing silly things like poking them with a finger then putting their finger in their mouth or not washing their hands after the lesson and then eating their sandwiches. It also prevents any significant amount of anything from the petri dish being breathed in.
BTW we did teach them sterile techniques, instruct them to not breathe on it, not touch it, etc, but the health and safety rules bear in mind that they are just kids and this is probably their first time doing any microbiology. The most usual organism grown is the one in live/probiotic yoghurt. But "lets see how clean our desks really are" is more interesting. And of course kids are directed to wash their hands afterwards.
Note#1: different local education authorities have different safety instructions, but they'll all err on the side of strictness. Outside the UK, I have no idea what the regulations are.
Note#2: in a proper lab (as opposed to a school lab) lab staff will be properly trained to avoid accidental contamination with the wrong organism - contamination with anything, however harmless, will screw up the study. But that doesn't mean contamination's impossible especially if people aren't following regulations properly. If the context is a school science lab or someone doing their own science at home, then there's a lot more scope for doing stuff wrong. Giving yourself a nasty infection is a definite possibility, even without sticking your finger in the petri dish.
Also note that if they are growing pathogenic bacteria for scientific research, the health and safety rules are stricter than for harmless bacteria. The more dangerous the organism, the stricter the health and safety. You can probably google to find out the different levels of regulations for different organisms. The higher level of control would make it much harder to accidentally infect yourself or anyone outside the lab (carrying pathogens home on your clothing etc) so it would be difficult to contrive a scenario where the pathogen escaped from the lab, for fictional purposes. But it's still possible if people are flouting health and safety regulations.