Merriam-Webster. To my knowledge, touching the rim has never been part of the criteria for dunking.
The origin of the phrase was a sportswriter who made the analogy to dunking a doughnut in coffee. To my knowledge, touching the rim of the coffee cup is not necessary in order to dunk a doughnut in the coffee. I would say that carries over to dunking in basketball. The downward motion is the key - not contact with the rim.