yes, they can eat rosemary. But:
the amount of Calcium is 317mg/100g; the amount of Phosphorus is 66mg/100g. Therefore the ratio Ca: P (which is extremely important for piggies and should be 1,2-1,5:1) is 4,8:1.
Too high...
of course you will not serve 100g, but this is what rosemary contains (some charts say even higher values). I don't know if rosemary contains also oxalates, dangerous for kidneys/bladder.
Anyway, some little piece of rosemary will not damage anything, I guess!