I haven’t got a clue what she is doing, but I doubt she got it from other children. My first concern is that she might have been hit in daycare, but if you have her in a good facility, that would not happen. Look into it nonetheless. It is possible that an older child might be the model for such behavior, as sometimes a 7- or 8-year-old will assume that moralistic/supervisor role. However, I doubt there is that much age spread in your daughter’s daycare.
You say that your daughter does this when you catch her doing something wrong. Sometimes a child will be very precocious in the development of a sense of right and wrong. When your daughter says this, she may be saying in effect, “I’ve been bad and you should punish me, but give me some reassurance that you won’t.” The next time she says this, try saying something like, “I won’t hurt you, but I do want you to remember not to do that (the wrong act) again.” Then distract her with something she can do that is acceptable.
Our parenting advice is given as suggestions only. We recommend you also consult your healthcare provider, and urge you to contact them immediately if your question is urgent or about a medical condition.