Here is a way to guarantee 500 correct guesses.
Beforehand they split into two groups of 500. One group will assume that the number of black hats is odd, the other that the number of black hats is even. After the hats are placed they determine whether their own hat is black, given their assigned assumption. One of the groups will use a correct assumption and will all get their colours correct, the other group will be all wrong. This method therefore gives exactly 500 correct guesses every time.
The above is optimal, because the expected value of random guessing is 500, and with no extra information given to the logicians about how the hat colours are chosen, this cannot be raised. The only thing their strategy can change is the variation, and a variation of zero is optimal.
For the second question, using three colours of hats:
A guaranteed 333 correct guesses is possible.
Label the three colours by the numbers 0,1, and 2.
They split into three groups of 333 (and one left over who doesn't take part). One group assumes that the sum of all the hat colours is divisible by 3, one group that it gives a remainder of 1 when divided by 3, and the last that it has remainder 2 when divided by 3.
Exactly one of those three assumptions must be true.
Every person can work out their own hat colour given their assumption, so the group whose assumption is true will give all correct guesses. The other groups will all guess wrongly (and the person left over might guess wrong too).
So there are guaranteed to be 333 correct guesses.
This is optimal for the same reason as the two-colour version.
As @Acccumulation pointed out in a comment, in practice it is much easier to split the 1000 people into smaller groups, each of which then apply the solution strategy outlined above. That way they only need to look at the hats in their own small group instead of at all the hats.
So for two colours we have 500 pairs of people, and in each pair one assumes their hats will be the same colour (i.e. that there are an even number of black hats), the other that their hats will be different (i.e. an odd number of black hats).
Similarly, with three colours of hats there could be 333 groups of three people, each person in a group using a different assumption w.r.t. the sum of their trio's hat colours modulo 3.