Yes you can connect an UR collaborative robot to a raspberry pi. I have done connecting two networked UR3 and a raspberry pi using ethernet. That is a clever choice especially if you plan to use peripherials like webcams.
I implemented such a setup in the teaining lab we have for last year engineering students. That solution proven to be so good that it was also implemented in another lab that has 2 ur 10 robots.
As a footnote to previous reply : answering a question when you do not know is nice, remaining silent is even nicer.