Any good newer one will have a rotating code. The next code used is based on a secret value that is embedded in the device itself. This is a two-way device, so the receiver has to send an acknowledgement back so they can both go to the next code.
Once you record it, it is too late to use.
One way to break hack it is to steal the keyfob, press the button out of "earshot" of the car, and record the code. Since it was never received and acknowledged, this code is still valid for one time use. They can put the key back, break into the car, and the owner would never suspect how they got in.