Wow, I agree with pp that some of these responses are because it’s a rescue dog. This is a 2 year old doing normal 2 year old exploring of the world. Yes, something needs to happen, which the op is fully aware of, and there’s some good advice here about redirecting, talking about dog’s emotions and obviously keeping them apart at times to protect both the toddler and the dog. But some of the replies are positively draconian in terms of how some posters think is good parenting of a two year old.
With all we know about child development and what works, I’m really not sure about comments advising op to grow a backbone and get angry at her two year old.
I remember my dd at 2.5 - she often scratched her baby brother and acted out at times because she couldn’t regulate her emotions. An adult shouting wouldn’t have helped with this.
Op, you seem to have been very good at paying attention to the constructive replies and taking the others with a pinch of salt. I get it’s emotive and people may feel upset at the thought of a rescue dog feeling anxious in a place it’s meant to be safe, but this is a 2 year old. I think some of us forget what kids are actually like at that age.
Also op, the very fact you’re posting here means you do care, and I can tell you’ve already been trying stuff, not just wringing your hands, sighing and letting a dog be abused (you’ve already said the dog seeks out the toddler for play sometimes). It’s hard on this forum, things can become black and white when they’re actually not.
I’d advise to get a plan of action that you’re happy with and most importantly stick with it. Nothing’s going to work instantly but I think consistency is key. Instant consequences, anticipation and removing temptation, age appropriate emphasising how the dog feels and separation when you’re not present seems a good route to take.