At that age a few months makes quite a lot of difference, so the response would depend on whether she is nearer 3 than 2 I think.
Is it just poo that's going into the pants, or is she weeing too?
Was she speaking well before she started to stutter?
I would think that she is trying to tell you something! - but it need not necessarily be something serious. As has been said, she may have passed a hard stool and has been put off the whole business. Or maybe mum and dad had an minor altercation (we all do it) and she is puzzled. Or she saw something on TV that frightened her. Or.....so many things that might set her temporarily off-balance.
However, I think it would be a good idea to have a chat with the nursery, explaining what is happening. asking what they have observed and enlisting their co-operation in dealing with it. Children of that age feel very powerless and something that might have seemed very minor to the nursery worker might matter a lot to her. It is also important that they are dealing with this hiccough in the same way as at home, so that she is getting consistency.
I have to be controversial here and say that I think 2 is very young to be at nursery - I know that I am out of step with lots of people over this. I just think that when these tiny people are trying to find their feet in this strange world they need their Mum/Dad/close relative around - people with whom they feel really secure, and whose responses they can predict.
I think she needs lots of cuddles; lots of playing with; lots of reassurance. These things usually blow over. It is a puzzling world for these little people. The less direct notice taken of it all, the better.
I guess you are in biting the tongue mode - a natural state for grandparents!