Here is how it goes for both AKC (UKC is pretty much the same although the points are different):
1) All the males in the various classes show first.
2) The winners of each male class (Puppies, Open, BB, etc) show against each other for Winners Dog and Reserve.
3) Then the same for females and Winners Bitch and Reserve.
4) All the Specials (CH) and the Winners Bitch and Winners Dog go into the ring for Best of Breed. Out of this BOB, Best of Opposite Sex and Best of Winners is picked. The Best of Winners is between the Winners Bitch and Winners Dog and is important is it can mean more points for the BOW.
The only dogs that can earn points toward their title are the dogs in the classes. The major difference between UKC and AKC is in how the dogs earn points. You can go to the UKC and AKC websites for that, but don't be surprised if you have a hard time understanding the point progression at first.
This is a high level overview. If you want a more detailed explanation a good book for beginners is Dog Showing for Beginners by Lynn Hall (this is based on AKC, but close enough to UKC).
Let me know if you have more questions.