I’ts pretty easy to do in code. For any given maya command you can always store the default arguments in a dictionary and pass them with the ** syntax
cube_defaults = {'width': 1, 'height': 2, 'depth':3, 'name' :'fancyCube'}
cmds.polyCube(**cube_defaults)
It’s much harder to do this in the Maya UI, since the users will always be able to get in there behind your back and changed the defaults. The default settings for most node types are stored in optionVars. For example with cubes you’ll see
polyPrimitiveCubeAxis
polyPrimitiveCubeCreateUVs
polyPrimitiveCubeDepth
polyPrimitiveCubeHeight
polyPrimitiveCubeNormalize
polyPrimitiveCubeNormalizeType
polyPrimitiveCubePreserveAspectRatio
polyPrimitiveCubeSX
polyPrimitiveCubeSY
polyPrimitiveCubeSZ
polyPrimitiveCubeTexture
polyPrimitiveCubeWidth
You could set those to the values you want at startup and those would be the defaults that were used when the user hits the menu item or a shelf button (at least, if the shelf button does not set values explicitly). However there is no way to lock those values so the user can blow away your settings by opening the option box in the Create menu and changing them. There’s really no way to prevent that. Not every node type has associated optionVars either, so there’s no way to easily force preferences on, say, new file texture nodes.
If the values you need to set are mission-critical, you can add an idle scriptJob to check relevant nodes when the user is not busy and to either ask them what to do or silently update the values as needed. That will work for lightweight cases but idle jobs should be used with care: if you’re checking a few tens of nodes it’s fine, but if you’re checking thousands of nodes Maya will start to feel sluggish.
You can also just apply the fixes at save time, at export time, or render time – this will allow you to present the user with choices if you’re not sure what to do but also to make sure the data is good before it gets shared with others.