Any Pentax SMC prime is going to be quite good. In all likelihood better than the off-brand lenses, but of course there are some exceptions there.
All the K mount lenses are DECIDEDLY NOT made in the same factory. Pentax had it's own production, as did Ricoh, and several of the big 3rd party lens manufacturers made lenses for K-mount under their own names and relabeled. Ricoh lenses are generally quite good, though there is a little more variation than in the Pentax 1st party line up, and they made more consumer-focused glass, with fewer exotics like tilt-shifts, macros, and super-teles.
The Adaptall SP lenses, of course, come in K-mount and are good lenses relative to their contemporaries, but I don't believe the made much in the 28-50mm range, not wanting to compete with inexpensive and excellent first-party 35mm and 50mm kit glass.
Stay away from the K-mount Takumars, which are unrelated to the very good M42 Takumars.
The limited lenses are known to be very good, though I haven't shot with them so other posters on this thread are better informed in that area.
You would do well to look at the lens review database on pentaxforums, and perhaps join up over there. There are some very knowledgeable posters and a good, largely pentax-specific classifieds section. (Hopefully I'm not transgressing too much by plugging another forum here. I have been on there for years, since my days shooting Pentax, and still check in occasionally.)
Having used Nikon and Pentax, I would expect lenses of the same era, focal length, and aperture to have a fairly similar performance. I've also never been blown away by Nikon's wide primes. I use my Nikkor 28/2 much less than my 20-35/2.8, and would not be at all upset if an SMC-A 28/2 in F-mount miraculously appeared in my bag. YMMV.
Please feel free to send me a PM or reply here if there are any specific questions I may be able to help you with.