Can one acquire "tenure" through teaching or being something like a Research Associate at a university lab? This question is specific to the United States.

Can one acquire something like "tenure" if either 

(1) their primary / only responsibility is teaching undergraduate courses 

and / or

(2) they work as a Research Scientist for a university lab but are not professors.

I am wondering about job security, basically.
No, generally speaking, tenure is not offered to teaching faculty, usually called lecturers, or research scientists at American universities.  The AAUP has long argued that teaching faculty should also be eligible for tenure and they report that a small number of universities have created tenure tracks for teaching faculty.  But it's rare.

That said, if you can get hired full-time as a lecturer, your job security is pretty good, mainly because (speaking from experience serving on the lecturer search committee here at Michigan) it's so hard to find qualified individuals who want the job, given that it's so dramatically less attractive to academics than a tenure track appointment.