derives from the Aztec
word, “ahuacatl”, meaning “testicle”, as it is a rather large, ellipsoid fruit. Spanish conquistadors carried avocados to Spain in the 16th Century, where it was given the Spanish name, “aguacate”, later muddled with another Spanish word, “bocado”, meaning “delicacy” which produced a shift in pronunciation giving rise to the word, “avocado”. Avocado also means “lawyer” or “advocate” in Spanish, but there is no relationship between these and the fruit.
The name avocado appeared in English at the end of the 17th Century. The English thought an avocado was some sort of pear and so dubbed it an “avocado pear”, but later began calling it an “alligator pear” for no other reason than that “alligator” was a more commonly known word than avocado.
Note: There are many varieties of avocados, some smooth-skinned, some coarse-skinned. As I have no idea which varieties appeared in 17th Century England, I deliberately stayed with the recorded etymology of the word I was able to find, rather than resorting to theories I could not confirm as to how or why the word "alligator" came to be used.
By the way, avocados are wonderful served halved, scored, and drizzled with shoyu (soy sauce).