Baptism without receiving the Holy Ghost is not valid. It's the whole point of baptism.
"You might as well baptize a bag of sand as a man, if not done in view of the remission of sins and getting of the Holy Ghost. Baptism by water is but half a baptism, and is good for nothing without the other half--that is, the baptism of the Holy Ghost." (Joseph Smith, TPJS section 6, p. 314)
If the person receiving baptism's heart is not right, or those who they trusted as their teachers did not teach faith in God, but trust in the arm of flesh for example, their baptism will be fruitless; for God cannot be deceived.
"Behold, the way for man is narrow, but it lieth in a straight course before him, and the keeper of the gate is the Holy One of Israel; and he employeth no servant there; and there is none other way save it be by the gate; for he cannot be deceived, for the Lord God is his name." (Jacob, 2 Nephi 9:41)
"For the gate by which ye should enter is repentance and baptism by water; and then cometh a remission of your sins by fire and by the Holy Ghost." (2 Nephi 31:17)