Front I would not try.
Rear tire, Depends where the nail went in. In the sidewall it is toast.
Yes you can plug it but most places will not touch a motorcycle tire for good reasons. It can be plugged or patched. I have plugged the rear once but clipping down the interstate one day at 85 mph I thought about what could happen so I replaced the tire.
Not worth it in my opinion, I would replace it......
Neil