If you want in the output just
printf '%s' 'foo.bar\033[00m' | sed 's/\.bar\\033\[00m//'
Notice that both
[ has to escaped by another
\. Additionally I've added
printf to print the input characters as literal string, otherwise
\033[ could be interpreted as escape code followed by ANSI colour.
After question edit:
If your file contains control characters such as
printf "foo.bar\033[00m" > file
then to replace it write the following:
After hit Ctrl-vESC you should see
^[ on the screen, but not literal
[ (two characters), but one single control character.