Never had a problem with shaving gel ( or any other aerosol cans) but if you are worried about it "exploding" all over your suitcase just pack it in a ziploc bag and put it in a cosmetic bag. Then at least it is contained.
I know Virgin used to say no pressurised canisters in Hand Luggage they had to go in the hold. I dont think youll have any problem as the pressue doesn't change in the hold (Im sure I read its kept constant as is the temperature but might be mistaken)