No, you can not do that if you want to make any edits to apex trigger/apex class that should be done in a sandbox environment.