Welcome to Android Central! To plug in an external hard drive to the phone, you'd have to use an OTG cable, and that's usually just for USB flash drives, not hard drives--I'm not sure if the latter will work. If you have access to a computer, then you could plug the hard drive into the computer, and then connect the phone to the computer via USB. Now use Windows Explorer to drag and drop the photos from the phone's storage to the hard drive.
I would also strongly recommend backing up your photos to Google Photos in the cloud. If you choose the High Quality setting (which is essentially up to 16 megapixel photos, with only a small amount of compression), you get unlimited storage.
https://support.google.com/photos/answer/6193313?co=GENIE.Platform=Android&hl=en