Is it right to say "Choose any size if desired is sold out"? If not, how can I write it in a different way
I believe you are trying to say "Choose any size desired unless it is sold out"
If I were you however, I would shorten the phrase to "Choose any size". Shorter and easy to understand. I feel it is bad practice to indicate you might be sold out unless you require it.
You can't really refer to a "bare participle" like desired that way in English. A more fluent way to say it would be
Choose any size if your desired one is sold out.
You could also say
...the desired one...
...the/your desired size...