Sometimes the best (and only) thing you can do in these situations is walk away.
Whether you simply abhor politics or someone has crossed a line and the political conversations at work are getting offensive and/or destructive for the office, it's perfectly acceptable to excuse yourself from the conversation. You don't have to be rude about it, but a simple "You know, I'm not really comfortable talking about this at work so can we just move onto something else?" will do just fine.
Or, if you're worried about offending someone by taking that route, just whip out your smartphone and pretend you have a pressing appointment/meeting/work email that requires your immediate attention. The point is, everyone should feel comfortable in a workplace and you're being paid to work, not to reenact presidential debates.