I’m American, and I was born in the early 80s, so we used the R-word when we were kids to mean something was lame or stupid, and in the early 90s we would also say “That’s gay” - again meaning something was lame or stupid, such as “Your mom grounded you? That’s gay.” Then my best friend came out to me in the mid-90s and I realized that, even though all my friends (including said best friend!) were using the word “gay” to mean “lame” (and not directly as an insult to homosexual people) it didn’t make it okay to use the word as a negative word in the way we used it. I stopped using the R-word entirely and stopped using “gay” as anything other than its literal meaning. It is so easy to “stop” using racist/slur terms. You just have to want to do so, and you have to care about other people and how they feel.
OP, your MIL clearly does not care about how the “other person” feels when she uses a slur/racist term. At its base level, it doesn’t matter if SHE doesn’t think it’s racist. Her “intent” (so to speak) doesn’t matter. What matters is how the other person takes it (if they hear her saying it.) And if your DD spends more time around her, your DD will simply assume the D-word is “acceptable”/normal to use on people of color, and will start using it herself.
I saw the exact thing happen in my own family. My mom is 80 years old, and she STILL insists on using slurs/no-longer-acceptable terms - in public she calls black people “colored people” and calls Asians “Orientals”. She’s completely aware that these terms are no longer “okay”, as I’ve (gently) told her so, repeatedly, and explained WHY we don’t use xyz term any more. She always then asks, “Well, what DO I call them, then?!” (In an angry voice.) I’ve told her the currently-acceptable racial/ethnic terms AND have also told her “just don’t refer to their race/skin color at all…?”
She taught my older sister (age 49) the same horrid behavior and to use the same words - and worse at home: if they’re at home, they refer to black people as the N-word and call all Asians “ch!nks” regardless of the Asian person’s actual ethnicity. (Extra hilarious is that my boyfriend is Chinese. Yes, they’ve called him a “ch!nk” to his face. He’s unfazed by it because he already knows they’re terrible people.)
I’m adopted (my sister is not) and I am definitely not the favored child, so I luckily knew from a very young age that I did not want to be anything like my mother. My sister (the golden biological child) thought my mother walked on water and wanted to be just like her.
At two and a half, I’m not sure your DD is old enough to really understand the full impact of “we do not use this word because it is a mean/bad word” just yet. I’d personally limit her time with MIL unless you are also with them (and can nip it in the bud - if MIL uses the D-word, you can immediately say “oh, no, that’s a mean word!” - DD is old enough to understand that much and is likely to believe it from you, her parent.
Your MIL has zero excuses. She’s only 7 years older than I am (I’m 43) and I’ve never called a black person a D-word.
Depending on where your MIL lives, I have the same warning I tell my mom and sister: by using these kind of words on a regular basis, one of these days you’re going to say them in front of the “wrong” person and pay the price…