Where you buy a replacement truck oil pan will depend on how you plan to use the truck. If you plan on just regular, around town, and on the jobsite, a salvage yard will be your lowest cost option. A dealership parts center, NAPA, or Car Quest Auto Parts Store will have stock replacements, usually in stock for popular truck models. If you plan on using the truck offroad or performing high performance upgrades, you’re going to want a larger volume oil pan. With baffles to protect the crankshaft and keep oil in the oil pump pickup during radical maneuvers. You will need to visit a performance shop or an online catalog store for a performance replacement oil pan. One of these can be found here.
For more info, see How Does Truck Maintenance Differ from Car Maintenance