Nailing baseboards using nail gun on concrete wall
If you are considering an air powered nailer, the nail will just fold up when it hits the concrete. Powder actuated guns will not treat the base well at all, at least from my experiences.

You may be able to find case hardened 4D (1 1/2") finish nails. They will go in the concrete but it will take accurate striking with the hammer. I have seen and used them. I have seen them in place on a job I was helping demo.

The glue JACK suggests sounds like a good alternative, but if you are having issues with any glue, it still may have the same results.

Another way to nail which has been done before, but is still hand nailing, drill the concrete with 1/2" diameter holes, blow out all dust and glue in wood pegs. Set them in a  pattern that is easy to mimic on the face of the base, or layout whatever you drilled into the wall and use regular finish nails to hold the base.

You could do a "hybrid" of this. Cut and set the base on the wall as if it was to be glued only. Mark with blue tape the problem areas, like the base is bowing away from the wall or rising up off the floor. Using a finger, mimic where a single nail will hold the base where it needs to stay and mark with the blue tape. Drill those locations, clean the dust out the holes set wood plugs in glue, or perhaps carve them so they wedge in,  add glue on the back of the base, set in place and nail where the plugs are set to hold it in where needed and down where needed. The glue will do the rest.

Yet another alternative I have used is concrete screws. Set the base in place, drill the proper sized hole for the screw through the base and wall at the same time. Before setting the flat head type screw, counter sink the base so the screw does not have to sink itself, cracking the base possibly. It will be a larger spot to fill with putty,but it will grab and definitely hold.