Heaps of hospitals hire them out so yeah, if you sterilize all the parts it's fine.
Most machines nowadays all the tubing etc doesn't contact the milk its just there for pressure. All parts should be washable and boilable. And anyway breast milk has its own enzymes that kill bacteria, currently guidelines are that warm soapy water is enough no need to sterilize
Most brand allow you to change all the tubing. I'm going to use either my sister in law or one of my friend pump but I will be buying new tubing. The rest of the machine doesn't come in contact with the milk.