If the wire was bent into a rectangle with dimensions 5 and 7, the perimeter of this rectangle corresponds to the length of the wire:
![\begin{gathered} \text{Perimeter}=2\cdot5+2\cdot7 \\ \text{Perimeter}=10+14 \\ \text{Perimeter}=24 \end{gathered}](https://img.qammunity.org/2023/formulas/mathematics/college/2sacr0kec6gmh6cgc17ymtfkiq528pf5j9.png)
So if we use the same wire to make a square with side equal x, the perimeter of this square is 4x, so:
![\begin{gathered} \text{Perimeter}=4x \\ 24=4x \\ x=(24)/(4) \\ x=6 \end{gathered}](https://img.qammunity.org/2023/formulas/mathematics/college/23f9hqdo9yt9g1e9c966ftdfr3r00pueyq.png)
So the side of the square is 6 units, therefore the correct option is B.