Sure, you can use soap…
You may absolutely use dish soap to wash a cast-iron pan. If you’re a cast-iron newbie, know that there are people who will go all red in the face if you merely suggest using dish soap on a cast-iron pan, their blood pressure will rise at such heresy. It’s insane, obviously — there is truly no need in this world to get so upset over a skillet — but it should also give you, the cast-iron newbie, a sense of how good cast iron can be. People love it enough to get heart attack-level mad at the mere suggestion of maltreatment.