Changing custom ROM to another one or to stock rom
If you want to switch to other custom ROM just go to TWRP/CWM and perform the wipes and flash it, no need to install stock ROM. If you want to go to stock ROM than you'll need pc with software to flash firmware or via download mode on phone.