TeX processes tokens following its rules and \def\A{...} conforms to them. On the other hand defining tokens that way may break depending on what packages are loaded. Even \newcommand might not be sufficient, because packages could define their macros with \def, but in any case macros with the same name at the outer level cannot exist.
One should know what's being done, in other words.
To the contrary, defining macros before \documentclass is a well known practice. Suppose you have a part of your document that you don't want to be processed in certain situations. It can be done by enclosing the part in
\ifdefined\dontincludethispart\else
<part not to be always included>
\fi
(we assume that conditionals are properly balanced in that part). Calling the compilation of the file, named file.tex, with
pdflatex "\def\dontincludethispart{}\input{file}"
will not include the "secret" part. The comment package allows for similar tricks and has been discussed here on TeX.sx.
:-)– doncherry Jul 25 '11 at 11:46