D.T.
Uh... starting preschool IS a big change for a young child.
Anyways... don't yell or fuss or do anything to make her feel bad. Talk with her. Ask her if can feel when she goes. Call her doctor and go talk with him. She might have encopresis... it does affect 1 out of 10 4-10 year olds. That's when, at some point, the child got constipated (for various reasons, not just willingly withholding like some kids do, could be diet like dairy). Then the poop inside gets all hard and forms a mass and stretches the colon... softer poop oozes around it and runs out and she literally has no control over it at all. There are 2 sets of muscles we use - one involuntary and one voluntary... once a child looses feeling in the voluntary one you need to re-train the muscles. It often doesn't appear the child is constipated becuase of all the soft runny poops - but she could be impacted with a huge mass inside of her.
Make sure to rule out medical before yelling or discipline or her self-esteem will take a dive. It's very unfair to punish or shame a child over something they have no control over.