Novak Djokovic and Rafael Nadal earned opening wins for Serbia and Spain at the ATP Cup in Australia, where Dominic Thiem was beaten.