Any port in a storm is an idiom meaning that in an emergency, crisis, or difficult situation, you must accept whatever help, shelter, or solution is available — even if it isn't ideal or what you would normally choose.
Any port in a storm essentially means "anything is better than nothing" when you need help. The phrase comes from nautical terminology: A ship caught in a dangerous storm must take shelter in any available port to survive, not try to sail on to a favored harbor. Similarly, if you're stranded in a blizzard, and the closest motel is run-down and noisy, you'll probably stay there because, well, any port in a storm.