My data structure in cosmosdb is next
{ \"_id\": { \"$oid\": \"554f7dc4e4b03c257a33f75c\" }, ................. }
To use a special character, like $, you need to use bracket notation:
$
SELECT c._id FROM c order by c._id["$oid"]
You can do this with each property in the hierarchy, so the following also works:
SELECT c._id FROM c order by c["_id"]["$oid"]