If you travel with a submarine, you swim across the oceans but, as a safety measure, a submarine follows you around.
If you travel by submarine then you are one of a select few who is allowed to book a place on a submarine, or perhaps you are very rich and have your own sub that can take you where you want to go.
If you travel in a submarine, then it is probably a large submarine and you need a bicycle to travel around inside it.
However, if you use "went", you can say:
One day, I went to the pacific ocean. I went there by submarine. (perhaps you hired the sub)
One day, I went to the pacific ocean. I went there in a submarine. (perhaps you were a crew member of the sub)
One day, I went to the pacific ocean. I went there with a submarine. (perhaps you travelled on a large ship. Maybe the ship was carrying a miniature submarine for use when you arrived)