The short answer is that the "Word of God" shouldn't be read as prayer.
Within Biblical hermeneutics, there are two ways to interpret Biblical texts - either exegetically or eisegetically. That is - either one can read meaning out of the text and context into which it was delivered, or they can place their own ideas into the text, bending it to their own ideas and interpretations. While eisegesis may not always be bad, it is usually frowned upon and discouraged in modern scholarship and practice and is allowed only as an exception - generally not as a rule.
Which brings me to the topic of allegorical interpretation: allegory is especially susceptible to eisegesis. Genreally, nearly anything can be read allegorically and shaped to be an analogy for whatever the reader wants the story to mean in a manner similar to nonrepresentational art. This doesn't mean this is how the author intended for it to be read however. So one must ask in this case: how did the author of John intend his audience to understand this passage.
This is why I am glad to see this post on the philosophy Stack Exchange, and not Biblical Hermeneutics. By happenstance, it is actually better suited here. Because my primary activity and expertise on Stack Exchange is primarily in Biblical Hermeneutics, I will be approaching this question hermeneutically however.
The first step to making clear why the author did not intend for his readers to understand this text as an allegory for prayer is examining the Original Greek of the text. The importance of this task in Biblical Hermeneutics cannot be understated and generally, a good exegete will consult an interlinear translation of the text, and a solid lexicon. In this case, however, merely the interlinear will probably be sufficient for reasons that will shortly become obvious. According to Bible Hub's interlinear Greek/English text, the Word of God or λόγος τοῦ θεοῦ, can be transliterated as Logos tou Theos - Word of God. Theos may be recognizable to some as meaning "God", but "Logos" should really stand out to readers here who are familiar with classical western philosophy as a technical term used among the ancient philosophers.
As John was writing in Greek, he wrote to an audience at least somewhat familiar with Greek culture - even those Jews living in Roman occupied Israel. John was assuming that his audience was familiar with the term "Logos" and understood it to mean everything encompassed by Aristotle (according to ) it meant to Aristotle (according to Paul Rahe), the ability to understand
the difference between what is advantageous and what is harmful, between what is just and what is unjust, and between what is good and what is evil.
And also the belief of stoicism that Logos "animates the universe)
But most importantly Philo's understanding of Logos
...who used the term Logos to mean an intermediary divine being, or demiurge. Philo followed the Platonic distinction between imperfect matter and perfect Form, and therefore intermediary beings were necessary to bridge the enormous gap between God and the material world. The Logos was the highest of these intermediary beings, and was called by Philo "the first-born of God". Philo also wrote that "the Logos of the living God is the bond of everything, holding all things together and binding all the parts, and prevents them from being dissolved and separated".
Plato's Theory of Forms was located within the Logos,1 but the Logos also acted on behalf of God in the physical world. In particular, the Angel of the Lord in the Hebrew Bible (Old Testament) was identified with the Logos by Philo, who also said that the Logos was God's instrument in the creation of the universe.
So, in summary, while technically you could read "word" of God allegorically to mean prayer, this would be an eisegetical interpretation and is not how the author intended you to understand the text. Instead, he intended his readers to understand the "word" (Logos) in the context of Greco-Roman philosophy - especially the works of Philo.
1 Plato's Theory of Forms actually forms the basis and foundation for Triniterian Beliefs