US President Donald Trump has been relentlessly booed while attending an NBA Finals game in New York City.