Can I use indirect object after ask?
1. I am going to ask John a question.
2. I am going to ask a question John.(I think it's wrong, but not sure)
You can say "I am going to ask a question of John" and it means the same as "I am going to ask John a question".
If you say "I am going to ask a question, John", it means that you are talking to John and you are telling him that you plan to ask a question.
Remember - correct capitalisation, punctuation and spacing make posts much easier to read.