Scripture knows no Baptism but that of which water is the matter, and Luther maintains that you may baptize with beer, milk, brandy, with any liquid whatever. Calvin also believes that the baptismal water is a metaphorical water. [source]The quote is said to come from the Table Talk. With any obscure quote from the Table Talk, (unfortunately) it always must be pointed out Luther did not write the Table Talk. That said, it's possible this quote does come from that source, but as far as I've been able to surmise, the Roman Catholic author may have embellished a bit by adding milk and brandy, and more often than not, the context for this sort of comment has to do with emergency baptisms rather than simply a flippant "anything goes" method for regular baptism. For Luther, water was the typical means of baptism. Emergencies were something different.
Consider these statements from the current English edition of the Table Talk:
No. 394: Prenatal Baptisms Are Ridiculed December, 1532Consider as well this letter from Luther, late in his career:
“[According to Aristotle] the whole soul is in each and every part of the body. On this basis they [the papists] baptize a fetus which has not yet been fully brought into the world. Augustine treated of this at great length. If I prick my finger, my whole body feels it. Therefore, when I baptize a finger I baptize the whole body.
“I don’t wish to be baptized thus. But I don’t care about the element, whatever one may have. Indeed, it’s enough to speak the words. Let the children be committed to our Lord God. The baptism itself is of no concern to me. Besides, the Word is the principal part of baptism. If in an emergency there’s no water at hand, it doesn’t matter whether water or beer is used.” [LW 54:61]
Dr. Jacob: “Should a child be baptized with wine? I hear that such a thing happened,” etc.
Dr. Luther: “If it’s done, it’s done by accident. So in this instance what happened was that in an emergency the poor women laid hold of wine, thinking it was something else. That child shouldn’t be baptized again because when I take something to be something—when I think it’s water, even if it really is something else—there’s no danger at all. Under the papacy priests often elevated water instead of wine.” [LW 54:425]
To Nicolas Amsdorf, Concerning the dispensing of unconsecrated wafers.Consider though this comment from Martin Brecht:
January 11, 1546.
Grace and peace in Christ! As Dr. Cruciger and Dr. Major are absent, Pommer and I must answer you. First. It is not heedlessness, but rightdown wickedness of that curate to declare that consecrated and unconsecrated wafers (Hostien) are the same. Let him go to his Zwinglians. It is not necessary that a man who is not one of us should be kept in prison, whose word, and even oath, cannot be believed. Further, he who has partaken of an unconsecrated wafer has not sinned; for his faith has saved him, because he believed that he received the true sacrament, and trusted in God's Word, just as he who believes is baptized, although he who baptizes him plays with the ordinance, or uses some other fluid for the purpose. But we need not discuss this so minutely, in case of inflaming unenlightened consciences. It is enough that all is possible to him who believes. Regarding adulterated wafers, it would be well to burn them, although really not necessary, because they are no sacrament except in their actual use.! Even as baptismal water, except in its application in the rite, is no sacrament, even so Christ in this sacrament only operates on those who eat and believe.[source]
Certainly in Luther's thought, the main power in baptism was the Word of God, not the water itself:
Similarly, the sophists also talk nonsense when they discuss how Baptism makes righteous. Thomas and Bonaventura think that some power for bringing this about has been given by God to the water when the child is baptized, with the result that the baptismal water brings about justification by its own power. In contrast, we say that the water is water, in no wise better in quality than that which a cow drinks. But we maintain that to the simple water the Word of promise has been added (Mark 16:16): “He that believes and is baptized will be saved”; likewise (John 3:5): “Man must be born again of water and the Spirit.” If someone should want to call this Word or this promise a power that has been given to the water of Baptism, I shall not object. But the idea of the sophists was something different. They do not attribute this power to the Word, but concerning the element they state that it has a special power given to it. Scotus speaks more correctly when he defines Baptism as a divine covenant standing by the element.
Luther, M. (1999, c1958). Vol. 1: Luther's works, vol. 1 : Lectures on Genesis: Chapters 1-5 (J. J. Pelikan, H. C. Oswald & H. T. Lehmann, Ed.). Luther's Works (1:227). Saint Louis: Concordia Publishing House.
Luther's Small Catechism:
9 How can water produce such great effects?
10 Answer: It is not the water that produces these effects, but the Word of God connected with the water, and our faith which relies on the Word of God connected with the water. For without the Word of God the water is merely water and no Baptism. But when connected with the Word of God it is a Baptism, that is, a gracious water of life and a washing of regeneration in the Holy Spirit, as St. Paul wrote to Titus (3:5-8), “He saved us by the washing of regeneration and renewal in the Holy Spirit, which he poured out upon us richly through Jesus Christ our Saviour, so that we might be justified by his grace and become heirs in hope of eternal life. This saying is sure. Tappert, T. G. (2000, c1959). The book of concord : The confessions of the evangelical Lutheran church (349). Philadelphia: Fortress Press.