Answer
No.
Work Step by Step
If the charged particle’s velocity $\vec{v}$ and the magnetic field $\vec{B}$ are parallel to each other (or point in the opposite direction), the particle will feel no force and will move right through the cubical region, emerging on the other side.
Otherwise, the charged particle will begin to follow a curved path once it enters the cubical region of the magnetic field. However, it must eventually emerge. It can’t form a closed circular path without returning to the point where it entered the region, and thus leaving the magnetic field.
Here are some interesting tidbits about this problem. If we had such a magnetic field, the particle could come arbitrarily close to the limit of remaining inside the magnetic field. However, it turns out it is impossible to create a cubical region of space with a uniform magnetic field, where the magnetic field is zero outside. So this problem is purely hypothetical.