Quick note: there are many varieties of aloe plants and some of them smell like onions. If your plant smells, you may have one of the varieties that looks similar to Aloe vera ‘barbadensis’ but is actually Aloe vera ‘chinensis’. This variety works just as well as the ‘barbadensis’ if you can get past the smell. I have heard that leaving a cut leaf out over night helps reduce the smell and using leaves closer to the center of the plant helps too.
In the picture above, you can see that some of the yellow sap has dripped onto the counter, that’s the part that smells. I have the ‘barbadensis’ variety and it doesn’t smell oniony because there is very little yellow sap. I’ve heard that growing the plant in a pot and letting it slightly dry out between waterings can help too, but if you have a variety that is prone to the strong smell, there isn’t much you can do about the smell.