well, there isn't really any straightforward way to make node names unique once they exist like that (afaik) but you can turn on a "keep names unique" option in the duplicate options. You could then simply duplicate EVERYTHING in your scene and delete the originals but seriously, only a madman would consider such a thing...
it's best not to worry about duplicate names, but always ask for the LONG (full DAG) name as these are ALWAYS unique, no matter what.
so, if you are asking for things in a MEL command with ls
you use the "-long" flag, "-f" flag for listRelatives, "-fp" flag for filterExpand, and so on.. (check each commands docs for more info)
if you are just typing in names manually into the script editor or wherever, you must specify the unique name. This is more of a drag, but still simple. just select the object in Maya and maya will return the unique name in the script editor (i.e. group2|pCube1 instead of pCube1)
:nathaN