Can I make a post and baluster railing terminate into a wall?
You can attach the top of the railing to the wall with a handrail bracket: 



You should consider that a safety railing must do its best work during accidents and emergencies. At some point during its lifetime a stair railing will suddenly be subjected to over a hundred pounds of force in some random direction, and it will be because someone is already in trouble and is counting on the railing to save his bones. 

Of course you need to locate the bracket on a wall stud. 

But even with hefty screws driven into the stud, the bracket will eventually loosen and wobble because it will crush the plaster or wallboard behind it. 

You need to cut a plug out of the wall material and replace it with wood or plywood patch to support the bracket. A bit of spackling makes the patch invisible. 

Proper installation is a bit of work but necessary for complete safety. 

I mounted the stair rails in my house this way and they have not shifted a millimeter in thirty years.