Invariance properties of bacterial random walks in complex structures