While 10W40 might be suitable in some cases (particularly older engines or hotter climates), using an oil that doesn't meet the manufacturer's recommendations could lead to reduced engine performance, premature wear, or even damage. The recommended viscosity is a balance between cold-start protection (the "W" number) and high-temperature protection (the second number). Using an oil too thick or too thin can negatively impact your engine.
Always prioritize the oil specifications listed in your Dodge Dakota's owner's manual.