Can I save a "star-hash" (*#) code as contact?
It is not meant to be dialled as an ordinary contact number

Quoting from this answer 


  What the dialer really does when you enter the code is extracting the number between *#*# and #*#* and then broadcasting the following intent....


Saving it as a contact and trying to dial means it is a treated as a regular, valid number


Which is rejected by the service provider , since it is not a valid number
Expected code is not launched since the corresponding intent is not triggered


You can try creating a shortcut to the intent using an app like this or apps like Tasker