Yea, 40mm is 40mm, regardless of what camera it is put on. But the captured field of view depends on one more factor - size of the film plane / sensor. So you can mount that 40mm on Pentax Q, Pentax K-01, and Sony A7r and the images will look very different. The second part is the size of the image circle. A lens will work on the format that it is designed for (FF, APSC, medium format, Q, m43,..) and all smaller formats. But its image circle might not be big enough to cover a bigger camera's sensor or film. So if you put a Q lens on your K-01, most of the frame will be black, with a circle in the middle.
Just remember that focal length is not the same as field of view. So FA 200mm and DA 200mm will give you the same field of view if you put them on the same camera. Same for FA 35mm and DA 35mm, M 40mm and DA 40mm, and so on.. Its just that FA (and DFA) is guaranteed to cover FF, 35mm film; while DA is meant to be optimized for APSC and might not cover whole FF sensor. I think Nikon and Sigma designate lenses as FX and DX. Pentax uses DA and DFA now.
The only relevant differences between FA and DA is that DA has newer lens coatings, optimized for digital sensors, so they should have less ghosting and fringing on a digital sensor (since digital sensors are different from film, they are more shiny). And of course construction - older lenses have Aperture ring and distance scales, while DA lenses might not (depends on lens).
Here is a thread about which Pentax DA lenses work on FF:
https://www.pentaxforums.com/forums/54-pentax-lens-articles/31629-da-lenses-f...ts-thread.html
---------- Post added 7th Jul 2015 at 23:11 ----------
One more thing: Why make APSC only lenses at all? Well, the image circle size affects the lens size. That is why 50mm lenses for medium format tend to be bigger and slower than 50mm lenses made for 35mm film/FF. And spending extra resources, glass, on making a big image circle that doesn't even get used is pointless, might even cause loss of contrast with the extra light bouncing around the inside of the camera. That said, many DA lenses are based on FA designs and they still cover FF image circle. So in my opinion, Pentax could actually go further and make even smaller lenses with faster apertures for their crop sensor bodies, but I guess that would cost even more R&D.
And APSC exists because making big sensors is difficult and expensive. Or, used to be.