Is it okay to wash hands with body soap?

I finished pooping and realised my liquid hand soap had run out, so I used a body soap bar to wash them. I had to go outside and use the hand soap in another bathroom to make sure my hands were clean.

Can you use body soap to wash hands properly?