An ‘apology’ is, strictly, a defence—as Newman's Apologia pro Vita Sua (1864): A Defence of his Life—and there are many instances of apologetic in both OT and NT. Thus, Isa. 40–55 extols the transcendence of the God of Israel and compares him with the nonentities of the heathen. And both Philo and Josephus wrote to commend Judaism to pagans; at Alexandria Philo maintained that the Hebrew tradition was as ancient and respectable as Hellenism, and in Rome Josephus explained in his many works that the Jewish rebellion was instigated by a small group of fanatics.
The Acts, equally, has an apologetic purpose, though it may not be the primary aim of the book. But, as in the third gospel, where the centurion at the foot of the cross declares Jesus to be ‘innocent’, so in the Acts Christians are shown to be law-abiding citizens of the Roman Empire. If they are prosecuted, it is because there are Jews doing what they can to impede the progress of the gospel. Roman magistrates (like Gallio and others) are shown to be friendly to Paul, who can boast proudly of his Roman citizenship, and make use of it (Acts 22: 27).
There are apologetic interests in the gospels, as when Matthew repeatedly adduces OT texts which have in his view been fulfilled in Jesus.