I was about to say that the cucumber is really a red herring, but that sounded insane
Nevertheless, who owns the cucumber is irrelevant. Unless you or your daughter want the little one to grow up thinking that people who haven't paid for something are not entitled to respect. The principle here is that you are the grandmother, and should be respected - if your daughter takes issue with your disciplining she should take it up with you privately, not in front of the child you are trying to teach.
It does sound like a power struggle, and one you probably have to engage with, however much you fear conflict. I think that if you back down, you will always be seen by both your daughter and grand-daughter as a pushover.
It might be difficult, and I can tell you are upset, but the bottom line is that they are guests in your house, and you are within your rights to ask to be treated with respect. My advice would be to stick to that. Don't be drawn into the rights and wrongs of cucumber ownership! Respect is yours by dint of the fact that (a) you are an adult and the little one is a small child, and (b) it is your house.
Stick to one track - that you are not prepared to be treated badly by either of them, and don't let your daughter derail the argument. Refuse to negotiate on that, if you can?