Is it possible to create a serial number to protect game sales?

Short answer: yes.
Long answer: It will get broken in less than a day of it being out and you’ll just make it more annoying for people who legitimately purchase the game. Companies have spent millions trying to develop secure systems and all of them have been broken. Your best bet is to just make a good experience. The only thing you can really protect via serial is the online experience.