I have wondering whether hot water container can be used to keep cold water or vice versa. It is a trivial question, but I haven’t found any information online.
Basically, a hot water container could hold cold water, but not necessarily vise versa. That's because it really depends on the material of the container, and if it's suitable for hot content.
From your comment to your question, where you said:
like a vacuum flask
I assume you mean something like that:
In that case, yes, this kind of thermos will be able to keep hot or cold liquids.
The time it will keep each of them hot/cold may differ - for example, my thermos manufacturer stated that it's good for 24 hours of hot water, or 12 of cold water.
For best result, wash the thermos with "a matching" water temperature - if you're going to save hot drinks in it, give it a pour of boiling water - so it will be warmer and will keep the drink hot for longer.
And of course, for cold drink - the equivalent opposite + you can put some ice cubes inside, which will make it even cooler.
Yes. A thermal flask can isolate the contents from the ambient air temperature. They are the best at this.
It's important to condition the flask before you use it.
For example: Put hot water into the flask before you fill it with the liquid you want to keep hot. Pour boiling water into the flask… Let it sit for a while. Discard the conditioning liquid. Fill with the liquid (tea?) you want to remain hot.
And put cold water into the flask before you fill it with the liquid you want to keep cold. Pour ice water into the flask… Let it sit for a while. Discard the cold conditioning liquid. Fill with the liquid (tea?) you want to keep cold.
Tiny but important detail: The stopper must be a good thermal isolator or the whole deal is off. The stopper is the weak link in a thermal flask efficiency.
Avoid convenient stoppers that allow you to pour liquid without removing the stopper. They are inefficient thermal isolation.