Can a person have an allergy to whole eggs but not egg whites?

Essentially no. All of the antigens in the egg white will obviously be in the whole egg. However, some of the proteins are denatured enough by cooking to allow patients that are allergic to raw egg to be able to eat cooked egg. A blood test may help in determining if this is likely in an individual patient.
Rarely. The main allergens to egg are in the egg white. Rarely one can see a patient allergic to egg yolks. Food allergy patients should be seen by an allergist for a thorough evaluation.