"cannot be too [adjective]" means "it is not possible to be excessively [adjective]". No amount of the quality is so high that it can be called excessive.
"one cannot be too careful" means that "no amount of precaution is excessive": in other words, one should be as careful as possible, and must never think "I am being too careful". (So yes, your interpretation is right).
Though this is an often used form, it is not an idiom in the sense of having some unusual meaning: it is a literal meaning. "Cannot be too ..." is simply the negation of "can be too". "You can be too careful" means that there is some limit where precaution becomes excessive, and "you cannot be too careful" is the straightforward opposite: there is no limit at which precaution becomes excessive.
Another way to express the same things is:
There is such a thing as being too careful. [There exists is a reasonable limit on being careful.]
There is no such thing as being too careful. [There is no limit on being careful; one should be as careful as possible.]
Negations of "too" limits are tricky, and likely a source of difficulty for learners.
One issue is that we often think of the negation of a "too" clause (where "too" means "excess", rather than "also") verb as being some kind of "not enough" clause. For instance, people will probably think of "we don't have enough money" as the opposite of "we have too much money". So "we do not have too much money" is tricky: what is that, and how is it different from "we do not have enough"?
But the bigger problem is that negated "too" clauses usually have a different meaning from a strict logical negation, or are ambiguous between the logical negation and that other meaning:
We did not have too much money when I was growing up
in fact means "we didn't have much money". The word "too" is just there for emphasis.
The sentence does not mean "It is not the case that we had too much money when I was growing up". Another example:
This song is not too long, is it. [Ambiguous: "this song is quite short", or "this song isn't excessively long".]
Which meaning applies depends on the context and the emphasis. For instance:
This song is not too long, is it? [Genuine question: is the song excessively long?]
This song is not too long, is it. [Rhetorical question: the song is not very long, as I'm sure you agree.]
In "one cannot be too careful" we have the strict logical negation: "It is not the case that one can be too careful". Still, the other meaning can be invoked with "not too careful". For instance, suppose we see John walk carelessly down the hallway with a full mug in his hand and splash coffee on the carpet:
John isn't too careful, is he. [John isn't very careful.]
To catch the nuance, you have to use clues from the context, and if it occurs in spoken language, you have to pick up clues from emphasis (like in the "song not too long" example).