After recent problems with iCloud resulting in loss of data, I am now entering contacts as "On My Mac". Before the default account was iCloud, so contacts were not on iMac when data was lost.
What I would like to do, if possible, is add new contacts (in default "On My Mac") and have them automatically added to iCloud. That way I will always have a copy on iMac secure. iMac backed up regualrly. Was a big pain getting contacts restored.
That is not possible, On My Mac contacts will not sync with the iCloud account, you can do it manually though.
The simplest method be to periodically export your local contacts to a vcard file then import the file into your icloud contacts.