"Aguacate" is avocado. It comes from the Nahuatl "āhuacatl."
You may have heard that "āhuacatl" also meant testicle. That's because of the friar Alonso de Molina and his 1571 dictionary. He defined it as "fruta conocida, o el compañon." A well-known fruit, or "the companion." In old Spanish, "compañón" could also mean testicle.
But Molina's dictionary is the only original source for that meaning. No other Nahuatl source uses the word that way. If people did call them that, it was probably a joke, like how we say "nuts" in English (they do hang in pairs, after all).
The English word "avocado" took a stranger route. Back then, Spanish had a word for lawyer, "avocado" (today it's "abogado"). Some Spanish speakers started saying that instead of "aguacate," probably because the two sounded close. English borrowed that version.
Meanwhile, some other English speakers who heard it as "alligato" decided it was an "alligator pear."
So in English, you're eating a lawyer or an alligator. In Spanish, it's still aguacate.
(Sources → 1, 2, 3, 4, 5)
—
This came from my app, Vocablo, which puts widgets with Spanish words (including Mexico-specific slang) on your devices to help you casually study vocab throughout the day. No intense practice reminders, just something you can glance at. You can get two months of Vocablo Plus for free right now.