Regular boxed hair dye will not work on a synthetic wig. Synthetic fiber is plastic-based, so it does not absorb color the way human hair does.
What can work
Some cosplayers use fabric dye made for synthetic fibers, alcohol ink methods, or controlled color sprays. These methods are more like staining plastic than coloring hair.
What cannot work well
You usually cannot lighten a synthetic wig. Going from black to blonde is not realistic. Darkening a light wig is more possible than lifting a dark one.
Bottom line
You can sometimes tint a synthetic wig, especially for costume use, but you cannot dye it like human hair. Buy the closest color first whenever possible.