Attending school remotely to earn an online accredited high school diploma is no less legitimate than attending a brick-and-mortar school to earn a traditional accredited high school diploma.
It’s a good idea to confirm for yourself if you’re getting something legit before you enroll, though. There are plenty of online businesses that will sell you a phony high school diploma and they work very hard to appear legit. Some are actual school programs with curriculums that just aren’t up to snuff. Others are diploma mills that hand out diplomas but don't have any classes at all.