The celebratory tone of gay pride marches from San Francisco to Istanbul on Sunday were undergirded by an atmosphere of political expression and protest.