Theoretically, yes. However, it definitely is not going to help your medical school application. Getting into even one medical school these days are extremely difficult. Those who get into medical school have competitive GPAs and MCAT scores. If you have failed a class, it will undoubtedly affect your GPA.
One big misconception is that if you failed a class, you can retake it and replace the old grade. This is generally false. Even if your undergraduate college says that your new grade will replace the old grade, most (if not all) MD medical schools will not follow this policy. However, DO schools may only count the last instance of a repeated course; they will see the failed class regardless.