I got the lucky egg from Professor Kukui, and my friend sold it without me looking in Pokemon Sun. Is there any way to get that egg back?
Unfortunately there is no other way to obtain the Lucky Egg in Sun and Moon. Happiny and Chansey always used to have a small chance of holding the Lucky Egg upon spawning, but this is not the case in Sun and Moon. Sorry.
Hope I helped. :)