I’ve tried locking it in my CAMP, but fast travel to my camp often allows players to spawn inside the walls. One player, I believe with “Plague Walker” mutation was able to kill it just by walking around the perimeter.
There is a pacifist setting you can turn on in the games menu. It won’t stop other players engaging in PVP but it will help a bit of someone starts to cause trouble with you.
When it comes to your CAMP or anything in it, there is very little you can do to stop other players outside of building up a strong defence. It is quite rare for players to do this in the first place though. I have never once had any trouble from another player in Fallout 76. I leave all my purifiers unlocked for players to use and I share everything. I have found the majority of other players do the same thing.
If you are getting a lot of grief from the same player, try joining a different server. Chances are this will be a one-off thing that won’t happen again.
Perhaps the player feels the cow is wild and not yours. Put it in a pen and put a sign up to ask people not to kill it. Sounds silly but it people are doing this to you innocently, not knowing it belongs to you, then the sign will likely fix the problem.