**Yes, God has even used the pagans to preserve his word. God used the unclean to preserved his testimony many times, and still does no doubt.
He used Egypt to preserve Abraham from famine,
the Philistines to preserved Isaac from famine,
Egypt preserved Israel from famine,
the Philistines preserved David from king Saul,
first ravens, then a woman of Sidon, preserved Elijah from famine,
and Egypt preserved the child Jesus from king Herod. He used Egypt to preserve Abraham from famine. . .**
Did God also use pagans to decide which books belong in the Bible?
The scribes and Pharisees proudly preserved the OT scriptures, yet were also devoted to their own teachings and traditions, and were rebuked for it.