Baptism by immersion is not a magic ritual. Without belief in the true gospel it means nothing. It is not so much that there is only one true religion in the sense of one true sect but rather there is one true gospel. If you can find groups of differing names that believe that gospel then indeed their baptisms will be valid. If a group baptizes the right way but has a wrong notion of the gospel, then those baptisms are no better than taking a bath.
Here is a link to information available on the website directly related to your question:
One Bible, Many Churches: www.thisisyourbible.com/library/show/172
I hope you have found this helpful.
God bless,
Mike