I was once sexist to some degree in elementary school because of the whole "battle of the sexes in gym class dodgeball" thing going on (not anymore though), but then again, who wasn't at that period of their life?
If I ever make a sexist joke to begin with most of my female friends find it funny, just the same as when my black friends make racist jokes about white people, where I'm the white guy in question, and I find it funny. That being said, humor within a close group of friends who know you personally and will understand where you're coming from is usually the only appropriate time to make such remarks.