"Are you ok?" and "Did that hurt" are very common ways to ask someone if they are in pain.
"Are you ok?" can be used anytime someone is hurt.
"Did that hurt?" is better to be used when you see the moment they are hurt.
"Are you ok?"
(大丈夫ですか?)と
"Did that hurt?"
(痛いですか?)は誰かに痛いか聞くときにとてもよく使う方法です。
"Are you ok?"
(大丈夫ですか?)はいつでも誰かが痛がっているときに使えます。
"Did that hurt?"
(痛いですか?)はあなたが誰かが怪我をする瞬間を見たときに使うとよい言い方です。