Can a Glock 19 slide work on a Glock 23 body?

OK - I know there is the 9mm barrel option for a G23 and then G19 mags…and I have G19s, but want to explore the slide option if I get a G23.

Yea, just change the ejector to a .40 ejector.
If you already have some G19s why not just put a 23 slide on one of those?