Can I distribute Xcode at my company internally through configuration management scripts?
Everywhere I have ever worked in 30 years of IT work it is perfectly fine to place an installer on a local/network drive for in-house installation as long as there are no licensing issues.
And since XCode is free to use for anyone with a compatible Mac, I would think yes, this is fine.
Also macOS Server has (I seem to recall) a caching option which stores software updates on your internal network for the very same thing.