i’ve been learning about particles lately as im still new to the language i can't tell the difference between these two particles when used for locations for example: 街を歩く does this mean walk through town？ and 街に歩く does this mean walk to town？ thanks in advance for the help.
「街を歩く」means that people walks around a town and they must be inside of town. Here is another particle 「へ」, which is more familiar than 「に」 in this context. If people said that「街へ歩く」, this means that people head to a town and they probably are on their way to visit and must be outside of town. 「街に歩く」isn't a correct exression to use particle 「に」. To make it more sense with 「に」, I'd say 「街に向かって歩く」, which means almost the same as「街へ歩く」.