Catholics believe in the four senses of Scripture and that all Scripture should be interpreted, firstly by the literal sense (not literalistic, as in every must be taken as having literally happened). Allegory is only one of the spiritual senses of Scripture. See the reference to the Catechism beginning in paragraph 101. You may want to continue reading in the catechism to get a more developed idea of the four senses of Scripture.
116 The literal sense is the meaning conveyed by the words of Scripture and discovered by exegesis, following the rules of sound interpretation: “All other senses of Sacred Scripture are based on the literal.” [St. Thomas Aquinas, S Th I, 1, 10, ad I]
117 The spiritual sense. Thanks to the unity of God's plan, not only the text of Scripture but also the realities and events about which it speaks can be signs. 1. the allegorical sense. We can acquire a more profound understanding of events by recognizing their significance in Christ; thus the crossing of the Red Sea is a sign or type of Christ's victory and also of Christian Baptism. [Cf. I Cor 10:2] 2. the moral sense. the events reported in Scripture ought to lead us to act justly. As St. Paul says, they were written “for our instruction”. [I Cor 10:11; cf. Heb 3:1 - 4:11] 3. the anagogical sense (Greek: anagoge, “leading”). We can view realities and events in terms of their eternal significance, leading us toward our true homeland: thus the Church on earth is a sign of the heavenly Jerusalem. [Cf. Rev 21:1 - 22:5]