"The Grand Inquisitor" is set in Spain in the 16th century during the Spanish Inquisition, an attempt by the Roman Catholic Church to extirpate heresy. The Old Testament was composed over the period from approximately the sixth through the first centuries BC, and the New Testament in the first and second centuries AD.
The Inquisition was a fairly late and somewhat shameful period in the history of the Christian Church, involving the torture and killing of people suspected of heresy, including some of the leading thinkers of the Renaissance. No elements of the story are derived from the Bible, as the ecclesiastical structures to which the story refers only evolved several centuries after the Bible was written.
Theologically, Dostoevsky was criticizing what he saw as the ways in which the Christian church had departed from the teachings of Jesus.