why ac current flows in dc motor?
A vanilla commutator doesn't change DC into AC, it connects and disconnects the DC supply from the rotor windings - as the armature is rotating - at just the right time to make and break a  magnetic field which will interact with the fixed stator magnets in a way which will generate the torque necessary to rotate the armature continuously.