As far as we know, the Universe does not have a boundary. But, if it does, then we will need to know what are the boundary conditions in order to answer your question of what a particle will do when it reaches it. For example...
- The Universe could have reflecting boundary conditions, in which case the photon would bounce back from the boundary.
- The Universe could have transmitting boundary conditions, in which case the photon would leave the Universe forever.
- The Universe could have periodic boundary conditions, in which case the photon will effectively "circle around" the Universe.
Other boundary conditions are possible as well.
I would personally find the first two options are very weird, and the last one possible but also somewhat unexpected. But, this maybe just shows my own biases.