Painting wood trim is generally a one way street for most sane people. It can be stripped and refinished but it will be a PITA.
You can try to strip it in place but it will be messy, modern strippers will require multiple applications, you will still need to sand it. People have done it though.
Removing it, it will get damaged and you need to deal with all the nails in the boards. I recommend pulling them through instead of pushing them back out, that way they don't pop the wood on the good side. I have also seen people just cut them off flush on the backside.
Replacing, it depends on what kind of wood if you want to match it--availability and cost.
I have salvaged tons of trim in the house to reuse in new doorways, moved windows, renos, etc. Most I have paint stripped (adhesion problems in lower layers, sometime in the last 80 years--oil to latex.), repaired the removal and nail damage and repainted as there are adhesion problems in lower layers. Once done they were not in good enough condition to go back to natural wood, but look brand new repainted.