Is it ok to empty ampicillin from its capsule, and take it dissolved in water?

Probably fine. It will not go into solution well but it should be absorbed by the body. However, it probably would be best to take it in the original form of a capsule.