Are sure that you have dead pixels (a hardware problem) or stuck pixels (a software problem)? Stuck pixels can be fixed for free.
To see if you have stuck pixels, try going to www.flexcode.org/lcd2 (make sure you have Adobe Flash Player installed). Run their online software, which will make your screen flash rapidly a few times to “unstick” the pixels.
If that doesn’t work, then you may have dead pixels, which means that your LCD display needs to be replaced. There is a tutorial on how to do that at the link below: MacBook Pro 15" Touch Bar 2017 Screen Replacement
Please be aware, however, that a new LCD display will run you $699.99.