For example, the first one:
BKK(UL)HKG-SEL-LAX(UA)SFO
Means routing is valid if UL is used between BKK-HKG, any carrier between SEL-LAX, and only UA LAX-SFO. Same thing goes if more than one carrier specified.
My understanding is a little different. As this is a OZ fare, per default any flight has to be on a OZ-marketed flight within the specific routing, except noted otherwise. In the sample above, this means:
If you choose to route your trip including a segment BKK-HKG, this HAS to be on UL. If you route yourself BKK-SEL directly, you need to fly OZ on that segment. Same story in the end: If you fly SEL-LAX-SFO, the first sector has to be on a OZ-marketed and LAX-SFO on a UA-marketed flight. If you choose to go SEL-SFO directly, you are required to choose an OZ-marketed flight.
Now to the initial question, if you have (UA/LH) in the routing-rules, you can choose between the named carriers using any of their marketed flights on that segment - any reference/restriction in regard to flights "operated by" will be displayed somewhere else in the rules; I think that section is called "flight restrictions". If you can choose any carrier on a given segment, this would be noted as (YY) between the two airports.
Greetings - Dirk