Yes, you can. If you do add the onions when you saute the guanciale and add the garlic after those ingredients are finished cooking, allowing the garlic to cook for 30-60 seconds. Traditionally neither onion or garlic is in an amatriciana sauce, and if they are added you will need to let the sauce cook for 10-20 minutes longer.