Sally can run faster than any girl in the class.
This sentence compares “Sally” to “any girl in the class.” Such a comparison implies that Sally is not a girl. Since “Sally” is part of the group defined by “girl in the class,” it is necessary to use the term “any other” instead of “any.”
Sally can run faster than any other girl in the class.
This sentence correctly compares “Sally” to “any other girl in the class.”
Sally can run faster than any boy in the class.
This sentence compares “Sally” to “any boy in the class.” Since “Sally” is not part of the group defined by “boy in the class,” this use of “any” is correct.