There really are two questions.
Can attributes as a whole be applied to a class, method, or property?
Yes, attributes can target any of these constructs (and many others)
Is it valid for a specific attribute?
It depends on the specific attribute. Attributes can control which constructs they can be applied by enumeration AttributeTargetsand, therefore, make it illegal to apply a particular attribute to a particular construct.
, ParamArrayAttribute , ObsoleteAttribute ( , , , )