At least four officers were shot dead and others wounded during a protest in Dallas on Thursday night over police shootings of two black men in separate incidents.