Yes and no.
If your computer takes DDR2 memory for instance, there is a generic shape for them, but not all will work. All will fit, but your board may only accept certain speeds, any higher than them it will underclock the memory, or the speed will not be utilised by the system.
It depends entirely on what laptop we are talking about here, as to what memory you will be able to use