Approach 1:
As Skillmon already said you can use \providecommand instead of \newcommand.
(With \providecommand attempts at defining the macro in question take place only in case it is not already defined.)
Approach 2:
The standalone-manual says that document-environments of imported files are treated as local scopes/groups.
Therefore you can restrict the definition of \opt to the scope of a document-environment by putting it inside the document-environment. I know you usually don't perform \newcommand inside a document-environment but you can do it:
main.tex
\documentclass[class=article,float=true,crop=false, paper=a4,fontsize=11pt,twocolumn]{standalone}
\usepackage[subpreambles=true]{standalone}
\usepackage{import}
\begin{document}
\import{1/}{1}
\import{2/}{2}
\end{document}
/1/1.tex
\documentclass[class=article,float=true,crop=false,paper=a4,fontsize=11pt,twocolumn]{standalone}
\usepackage[subpreambles=true]{standalone}
\usepackage{amsmath}
\begin{document}
% have defining performed inside the document-environment:
\newcommand{\opt}{\text{OPT 1}}%
Subfile 1 $\opt$
\end{document}
/2/2.tex
\documentclass[class=article,float=true,crop=false,paper=a4,fontsize=11pt,twocolumn]{standalone}
\usepackage[subpreambles=true]{standalone}
\usepackage{amsmath}
\begin{document}
% have defining performed inside the document-environment:
\newcommand{\opt}{\text{OPT 2}}%
Subfile 2 $\opt$
\end{document}
Of course this approach works out only with macros that are not used outside the scope of a document-environment. I.e.: Tokens whose defining took place within a document-environment should not go unexpanded into moving arguments like referencing-labels or section-headings or \captions!
Approach 3:
In situations where all files are to use exactly the same preamble and postamble I don't use packages like standalone or subfiles at all but keep preamble and postamble in separate files and have LaTeX maintain a counter for keeping track of the nesting-level of \input with things that might need a postamble in case the nesting-level of \input is 0.
In case the preamble was already loaded and thus the \documentclass-command was redefined to be equal to \@twoclasseserror, processing preamble.tex is aborted prematurely via \endinput after incrementing the counter for the input-nesting-level.
In case the counter for the input-nesting-level is larger than 0, processing postamble.tex is aborted prematurely via \endinput after decrementing the counter for the input-nesting-level.
./preamble.tex
\expandafter\ifx\csname @twoclasseserror\endcsname\documentclass
\stepcounter{preambleinputcounter}%
\expandafter\endinput
\fi
%
% The preamble:
%
\documentclass[a4paper, 11pt,twocolumn]{article}
\newcounter{preambleinputcounter}
% import – establish input relative to a directory
\usepackage{import}
\usepackage{amsmath}
\newcommand{\opt}{\text{OPT}}%
\begin{document}%
./postamble.tex
\ifnum\number\value{preambleinputcounter}>0 %
\addtocounter{preambleinputcounter}{-1}%
\expandafter\endinput
\fi
%
% The "postamble":
%
\end{document}%
./main.tex
\input{./preamble.tex}%
\import{./1/}{1}
\import{./2/}{2}
\input{./postamble.tex}%
./1/1.tex
\input{../preamble.tex}%
Subfile 1 $\opt$
\input{../postamble.tex}%
./2/2.tex
\input{../preamble.tex}%
Subfile 2 $\opt$
\input{../postamble.tex}%
\providecommandinstead of\newcommand. – Skillmon Nov 01 '20 at 22:01