Its hard to know if it was fight or play without seeing it. It sounds like you did the right thing though. The man is more at fault because he did nothing.

Please stay safe when you're walking. I don't want you or Rex to get hurt.