It is true that high altitudes can cause an increased risk of ear infection. JohnP mentioned in his comment that on the National Institutes of Health (NIH) website for acute ear infections, it says that "Changes in altitude or climate" can increase the risk of getting an ear infection. The reason for this is also explained on the NIH website. That page describes very succinctly what happens to your ears when you experience changes changes altitude (ie: going up a mountain, flying in a plane).
The air pressure outside of your body changes as altitude changes. This creates a difference in pressure on the two sides of the eardrum.
This difference in pressure can block your Eustachian tube, the tube that connects the back of your nose and upper throat to your middle ear, which can cause an ear infection. A blockage in the Eustachian tube can also lead to something known as ear barotrauma, which is just discomfort in the ear, not a full ear infection, but may look and feel similar to one if it is severe enough. It should also be noted that young children are at a much higher risk for their Eustachian tube to be blocked, which may also be a contributing factor to why your daughter got an ear infection.
NIH: Ear infection - acute
NIH: Ear - block at high altitudes
NIH: Ear barotrauma
WebMD: Blocked Eustachian Tubes
Healtline: Ear Barotrauma