Yes. The 1N4007 can withstand a higher reverse voltage(\$V_r\$), 1000V vs. 50V. The 1N4007 may even be a better choice, esp. if your motor is powered by a voltage near 35V. (The 1N4001 is rated for a \$V_{r(RMS)}\$ of 35V.)
While diodes like 1N400x may be well suited as freewheeling diodes in terms of voltage and current (rated at 1A), they're not exactly fast. To protect your transistors Schottky diodes would be a better choice, but they usually have limited \$V_r\$.
Here's the \$V_r\$ for the 1N400x series:
1N4001: 50V
1N4002: 100V
1N4003: 200V
1N4004: 400V
1N4005: 600V
1N4006: 800V
1N4007: 1000V
The forward voltage itself is not really the value that you need to worry about - using it in this circuit won't break it as you aren't going to be intentionally dropping large voltages across the diode. In fact it is the power rating of the diode you need to look at.
Why? Well, you will need something at the output to pull it down when both are low - e.g. a resistor.
With the diodes your signal output levels will e reduced - by the forward voltage drop of the diodes. So if you have say a 10k pull down resistor, this would mean when the 3V logic signal is pulsing you will get a 0V low level (pulled down by the resistor) and a 3-Vf=2V
high level (sourced through the diode). In this case you would have Id=2/10k=0.2mA
flowing through the diode which should be fine for most diodes (it is only ~0.2mW).
For the 5V logic signal you would have a 4V
high level output, and in this case there would be 0.4mA
flowing through the diode, which again should be fine.
The problem with this is that if the load on the PWM signal is quite highly capacitive then it will switch from high to low quite slowly as you only have the resistor doing the switching. If the PWM signal was driving a large power transistor which would have a fairly high gate capacitance, this slow switching could cause excessive heating in the transistor (but that is a whole other story).
If you want to switch faster you may find you need to reduce the resistor value to increase the speed in which the output is pulled low. When doing this you have to be mindful of the current that flows through the diode and on through the resistor during a logic 1 and hence the power dissipation in the diode (Vf * Id).
Given you have a 3V signal and a 5V signal, what you can do (and I have done in the past) is use a TLL level 2-input OR gate (e.g. 74HCT32). These tend to have high input voltage thresholds (Vih) which are quite low and can thus run at 5V but support a 3V input (e.g. this 74HCT32 has a Vih of 2V on a 5V power supply). By using an OR gate like this you eliminate the issue of voltage dropped across diodes and get a Push-Pull output - the output of the logic gate sources and sinks current, so you don't need the pull down resistor.
Best Answer
The 1N4007 is physically bigger and designed for higher current and voltage loads than the 1N4148, but in this case it should be a suitable replacement.