In short, spray painting on property that is not your own is illegal if you do not obtain permission. If you have permission, it is legal.