Normally, internal gears are cut on a gear shaper. The cutting tools are made to cut the internal tooth form.
An internal gear can also be produced on a mill with a shaper attachment and a rotary table; a horizontal shaper with a rotary table mounted vertically; a vertical shaper/slotter or? Could also be produced on a wire EDM.
Be sure you know what the correct INTERNAL gear tooth form is. Your tool must match that form as the tool determines the form.