Yes, certainly will transmit outside the ham bands. The Heathkit DX-40 & DX-60, the Johnson Ranger I & II, Viking I & II and similar boatanchorage were the main tools of the trade decades ago.
A lot of the time people were using crystals to get to those frequencies as the VFO would not cover it. There was a healthy trade in used out-of-band crystals but companies like JAN Crystals (now out of business) would make new ones for you for little money.
In the 1980s, the US activity was in 7300-7450, more or less, with some in 48 meters too. I know of people that used these rigs at frequencies in the tropical bands, for example 3200-3400 KHz. This gives you some idea of how out of band they could be used.
A few things to note:
1) If the DX-40 has been sitting around unused for decades, be weary of the big electrolytic capacitors. Consider replacing the big electrolytic capacitors before even applying power for the first time.
2) I'm too lazy to search but I'm sure that there are webpages of recommended modifications for a DX-40 for better audio.
3) As Beerus Maximus mentioned, audio modulation may be problematic. MP3 players and computers these days are low impedance outputs, often < 100 Ohms and the DX-40 wants something much higher.
One possible alternative is an output transformer "turned around" so that the low impedance side connects to the MP3 source and the high impedance side connects to the DX-40. Output transformers from tube guitar amps is one source.
These guys make new ones:
https://www.hammfg.com/electronics/transformers/classic/1750?referer=1101You won't need a big, power handling transformer for this.
EDIT: Which means that these might be a better option:
https://www.hammfg.com/electronics/transformers/audio, especially the studio or broadcast quality transformers, for obvious reasons.