The difference between both diodes is that 1n4148 is a signal diode and 1n4004 a rectifying diode.
1n4148 will be able to operate much faster but can handle low currents only. This is used when transferring data, where current is low but lots of information goes by.
1n4004 will not operate as fast, but allows for much higher current, which is used in power supplies for example.
If, the diode doesn't need to switch fast, then it will work.
As a temporary or testing solution, yes it will work. For prolonged use, you'd best get your hands on a stack of 1n4148, as they are very cheap, and used almost everywhere.