In example:

If someone sells homemade ice cream where they have crumbled oreos and mixed in to make homemade Oreo ice cream, but generically named "Cookies & Cream"

or

If someone uses Great Value knockoff of M&Ms in their homemade cookie dough, and sells it as something like "Rainbow Chip Cookies"

Is this legally ok to do?

If not, what would it take to be in compliance?