When two photons (or light beams) travel in opposite directions, they each move at the speed of light relative to an observer. Regardless of their relative motion, the speed of light in a vacuum is constant and is always observed to be the same by all inertial observers. This principle is one of the fundamental tenets of Einstein's theory of special relativity.
Therefore, if two photons are emitted in opposite directions, each photon will still travel at the speed of light relative to an observer in any reference frame. The relative velocity between the two photons will always be the speed of light.
Now, regarding your second question about two objects with mass traveling in opposite directions at a little over half the speed of light, the relative velocity between the two objects will not exceed the speed of light. According to the theory of special relativity, the velocity addition formula is used to calculate the relative velocities between objects moving at significant fractions of the speed of light. This formula accounts for the effects of time dilation and length contraction, which prevent the relative velocity from exceeding the speed of light.
In the case you described, as the objects' speeds approach the speed of light, the velocity addition formula would show that the relative velocity between them approaches the speed of light but never surpasses it. The objects' speeds will always be less than the speed of light in any reference frame.
In summary, both in the case of photons and objects with mass, the principle of special relativity ensures that their relative velocities will not exceed the speed of light in a vacuum.