When doing Factory Reset over your mobile phone, it just removes your data from Internal Memory of your Android phone or at least that's the case in Android. Your external SD card is safe at that point. Just in case something goes wrong, it is always important to backup before performing such operation.