Record and recognise IR Code independently from Protocol
Your idea is potentially feasible but there are some issues to overcome. 

1) The typical IR receiver module will strip out the 36/38/40 KHz carrier frequency from the detected IR transmission and present the decoded envelope waveform at its output. IR receivers are typically optimized for detections at a particular carrier frequency and so it may be necessary to make your device with multiple IR receivers for the carrier frequencies that you would like to support.

2) One reason to understand the actual protocol used by a particular IR remote device is to allow the detecting device to apply bigger margins to the detection pulse width windows. Without the protocol known the margins on pulse width detection have to be tight enough to match the worst case narrowest pulses (and highest pulse rates) of the set if remotes and protocols that you would plan to support.

3) There can be significant differences between the detected timing of pulse widths between "learn mode" and actual "use mode". This occurs because in the learn mode the transmitter remote is typically much closer to your device than in the usage mode. Pulse widths of the detected waveforms can be distorted at the receiver during normal usage scenarios due to multi-path conditions, reflections and ambient lighting conditions. These factors can make repeated reliable detection a challenge. 

4) The variation of the carrier frequencies used by different remotes could lead you to using a design where you did not use a typical demodulating IR receiver but instead use a photo diode to detect the IR. In this mode you would get the actual signal transmitted by the remote and could be insulated from the carrier frequencies of assorted remotes. 

5) Detecting at the raw carrier level can lead to some difficulty of determining a reliable starting point of a transmission. Most "protocols", after demodulation, have pulses that can be detected to identify as a start or sync pulse. 

Hope this information is helpful for you in considering your path ahead.