The short answer is yes. Cartridge razors, where the cartridge can be detached from the handle and covered with a plastic head, are usually fine to take in your hand luggage on a plane. Disposable razors are also okay to take in your hand luggage, as long as they are in their packaging.