Short answer, it will work fine in most cases.
Long answer, playing while charging will produce more heat and has the small risk of overheating the device particularly when the battery is lower thatn 80% as @TomCgcmfc said. It can also degrade the battery faster in the long term. I always refer to a linus tech tips video where they did some testing and found that to maximize your battery life keep the charge between 60% and 90%. The video was for cell phones but applies to pretty much anything with a lithium ion battery like the quest.