This is an area where meaningful scientific research is impossible. The main problem lies in the concept of "legal name". There are hundreds of countries with their own laws, which may range from statutorily limited choices for names to no "legal name" or alternatively "any number of names". In the US, a child's birth and name are generally recorded by the government, which you can take to be one standard for "legal name" in the US. You can use that birth certificate for various legal purposes such as obtaining a passport: a party may demand that the name you use on a form match said documentation. If the parent(s) enter "Megan" as the child's name, that is the child's legal name; if they enter "Meghan", it is thus "Meghan". Likewise various spellings of Brandy, Rob vs. Bob, and the pattern M{u,o}ham(m)ed.
It would be hard enough to gather reliable statistics on the "currently used name" for a large random sample of humans, and it would be impossible to correlate such data with legal documents – even in the US, where there generally are such documents. In Matumbiland, there traditionally is no "legal recording" of names, but a person has up to three names in their life. In many cultures, a name is "private property" and you can't go interrogating people about their name. Moreover, many languages are not written so spelling of names can be extremely fluid.
Then finally there is the question of what one's "preferred" name is. A preference may be contextual, for example "the name I use at work" vs. "the name I use with family". Defining the criteria for "preferred name" seems seriously fraught with complications, and it would be better to simply gather together "all of the names". Which then raises the question of whether you are looking for "names of the moment" vs. "names throughout life" (bear in mind that a person may repudiate an earlier name).
Names can't be nailed down because they are extremely fluid and personal.