My first thought on reading this question was whether it was in the right forum. Should this be part of the Hermeneutics or Christianity site? But then I considered that interpretation of the text and more general reflection on the meaning of baptism are both necessary, so the question fits well in either place.
In Matthew 28.19-20 the relevant part of Jesus' command reads as follows:
πορευθέντες οὖν μαθητεύσατε πάντα τὰ ἔθνη, βαπτίζοντες αὐτοὺς εἰς τὸ ὄνομα τοῦ πατρὸς καὶ τοῦ υἱοῦ καὶ τοῦ ἁγίου πνεύματος, διδάσκοντες αὐτοὺς τηρεῖν πάντα ὅσα ἐνετειλάμην ὑμῖν.
which the NIV translates as:
Therefore go and make disciples of all nations, baptizing them in the name of the Father and of the Son and of the Holy Spirit, and teaching them to obey everything I have commanded you.
The grammar of the sentence suggests that the primary command is μαθητεύσατε ("make disciples"). The other verbs are πορευθέντες (going), βαπτίζοντες (baptising), and διδάσκοντες (teaching). These are all participles rather than imperatives. So a reasonable reading of this text is that Jesus is issuing one key instruction, namely to make disciples. The other verbs are participles which point to the process involved in carrying out the command. A paraphrase to bring out this idea would be:
[Jesus said] "Disciple the nations by going, by baptising, and by teaching…"
This final word of Jesus functions as a general template for his disciples, who are commissioned to be a mission focussed church. Jesus came to bring about God's kingdom. He now passes the torch to the disciples, who are to take that kingdom out into the whole world. We read parallel commissions elsewhere in the gospel tradition:
“This is what is written: The Messiah will suffer and rise from the dead on the third day, and repentance for the forgiveness of sins will be preached in his name to all nations, beginning at Jerusalem. You are witnesses of these things. I am going to send you what my Father has promised; but stay in the city until you have been clothed with power from on high.” (Luke 24.46-49)
Jesus said, “Peace be with you! As the Father has sent me, I am sending you.” And with that he breathed on them and said, “Receive the Holy Spirit." (John 20.21-22)
"You will receive power when the Holy Spirit comes on you; and you will be my witnesses in Jerusalem, and in all Judea and Samaria, and to the ends of the earth.” (Acts 1.8)
Now it's important to understand both what this commissioning template says, and what it doesn't say. To take an example, in Acts 1 Jesus commands his disciples to be "witnesses". What exactly does this word mean? In order to obey this command, what do Jesus' disciples need to do? This can be answered at at least three levels.
The first answer is derived from the natural range of meaning the word has in Acts 1.8. To witness is to testify, to describe what one has seen and heard. And in particular the testimony is about Jesus and is authorised by him ("my witnesses").
The second answer is provided by the range of examples spread throughout Acts. This is because the literary structure of the book is to show how the command to witness was carried out. Luke begins with the command and then spends the rest of Acts illustrating it. And so we learn that witness includes that which the Holy Spirit inspires in his disciples. We learn that witness can be a one off activity (Philip and the Ethiopian eunuch) or a structured process (Paul's missionary journeys). We learn that witness is focussed mostly on the apostles but by no means limited to them (the birth of the church at Antioch). We learn that witness is not limited to testimony of "what we have seen and heard", but extends to showing how these events are a fulfilment and continuation of the Old Testament scriptures. These are no more than selected examples which we could easily add to. The critical thing to note is that if we ask what it means to "witness" in Acts 1.8, the answer turns out to be far deeper than what we would see if we limited ourselves to that one verse.
The third level takes that principle even further. Acts 28 is not the end of the command. We find Paul preaching at Rome, the heart of the then known world, and the implication is that this will continue from there "to the ends of the earth". So in the same way that the scope of "witness" is expanded as we follow the story from Acts 1 to Acts 28, it's arguable that it could be expanded further as the gospel is taken to new places, new people, new cultures. Subsequent generations are to be witnesses, and their witness will be consistent with Acts 1.8, and with the narrative of Acts at large, but need not be identical to that story. We are the offspring of the church in Acts, not its clones.
So Jesus' one or two sentence commission should be understood as a broad template of the process involved. Jesus is commanding his disciples to continue his work in new settings, and his commission is not to be interpreted narrowly. Rather, they are sent and released to do whatever seems right to fulfil that commission based on wisdom, experience and the leading of the Spirit.
Coming back to Matthew, the command is to go, baptise, teach. No-one would argue that the "teach" element in this sentence requires us to teach the young children, university students and grandparents in our church exactly the same. We agree that teaching is proper for all of them in order that they may be fully discipled as Jesus has commanded. But how we carry out that teaching process is completely undefined. We may use all the resources of the contemporary church (training, age appropriate resources, spiritual giftings) to obey Jesus at this point. Why is baptism any different?
My reading of this passage is that the focus of baptism is on what the church does, not what the individual does. The church is to make disciples. The church is to go. The church is to teach. And in the same way the church is to baptise. So baptism in this context refers to the process of bringing people into the church. In other texts it will have deep sacramental meaning for the individual believer, but that's not Matthew's focus here. Matthew could have written "Make disciples by going into the world, bringing people into the church and training them up in the Christian faith." If he had, the core meaning would have been the same.
So to sum up, I think it's impossible to determine from this text alone that children can or cannot be baptised. If the Bible at large limits baptism to adult believers, then that's who we should be baptising to be consistent with this command. But if there are valid reasons either within or consistent with scripture to baptise children as well, then we should baptise both children and adults into the church in accordance with this command. The flow is from baptism to teaching. So there is nothing in the command that says a certain minimum level of teaching must have been carried out before baptism. All it says is that at the end of the process a well discipled person will have been both baptised and trained up in the faith. The order is irrelevant. To baptise a child and then teach that child "all that Jesus has commanded" is precisely in accord with this text.