Ownership of environmental samples (or other material) analyzed during a PhD
Since you ask for legality, you need to consult a lawyer for an answer. Everything expressed here is my personal opinion based on my experience as a researcher. It is not legal advise.

You say, you received the sample based on a collaboration of your university with the sample supplier. This probably means, you acted as a representative of the university when receiving them, because you wouldn't have received the samples if you were not affiliated to the university. From this it follows that the university owns the samples. This is also reinforced by the samples being processed with university resources.

I wouldn't do anything with these samples against the university's or my supervisor's wishes. 

However, if you have disagreements about this with your supervisor, you should try to solve this conflict or even find someone who can mediate the dispute. A compromise that makes both of you happy might be achievable.