No reason it shouldn't work on the KTM. Just make sure you have the correct fittingts to tap into an existing line or ports and a one way check valve to keep the oil from draining back into the engine cases when the motor is shut off.
An oil cooler is not something designed after an education in Rocket Science. Its just a simple heat exchanger, like a small radiator. Key issues would be to mount it where it can be protected, from crashes and flying debris. I holed a Porsche oil cooler at the track and it almost cost me a $20,000 motor. One of the easier places I have bolted aftermarket oil coolers is next to the radiators as it receives great airflow. XR 400's have them mounted around the steering head.
Keep in mind they do not have to have a huge surface area to be efficient. Here's a custom KTM cooler I have on my bike and you see the surface area is not overly large.
Custom shapes should be able to be made in most metropolitan areas.
You can getthe original XR400 cooler from Honda that fit around the steering head, though I'm sure its pricey, but at least it should be a bolt on item. Second choice is fabbing up a power steering cooler to fit on the bike or have a custom unit made up to your dimensions.
The XR's though are fairly robust motors and I thought hold almost 2 quarts in the motor, which is a decent amount already. Though not sure about your XR400sm.
Here is a pic of an XR400 cooler. you can see it just above the bottom triple clamp in front of the steering head.
I've just bought an HEL cooler (about £250) for my gsx14 as one of the many goodies I've picked up while I'm in the UK. Nobody mentioned getting a local one when mine failed in bkk or I might have given it a try.
Incidentally, an oil cooler around the headstock may cause head bearing failure as the heat will melt the grease. This is thought to be a problem on the 14 and mine did fail. I think some people grease the head bearings with copper grease to get round it.