Mattel Inc. was hit with a consumer class action over “Wicked” dolls whose packaging contained a link to a pornographic website.