Old West Hat

Both are old British terms that come from shortening other phrases. Don comes from “don on” meaning “to do.” Doff originates from the Middle English”doffen,” which became “don off” meaning “to do off.”  Hence, a gentleman dons (puts on) his fedora upon leaving and doffs it (takes it off or tips it) in the presence of a lady.