In the Standard Model, protons are considered to have an infinite lifetime. See https://en.wikipedia.org/wiki/Proton#Stability "The spontaneous decay of free protons has never been observed, and protons are therefore considered stable particles according to the Standard Model."
Now, according to wikipedia about $\beta^+$ decays,
https://en.wikipedia.org/wiki/Beta_decay#%CE%B2+_decay
the $\beta^+$ decay "may be considered as the decay of a proton inside the nucleus to a neutron" : $p\rightarrow n + e^+ + \nu_e$
Does it mean that there is really this decay that happens ? if so, how is that compatible with the fact that the lifetime of proton is expected to be infinite.
How could the fundamental law of authorized decay/forbidden decay be different inside the nucleus and outside nucleus ?