Yes, a person can masturbate with almost anything. However, not a good idea to use random objects as they can damage the soft tissue down there.
Fingers, stuffed animals or pillows, shower/tub faucets, are probably the most common.