Does shardCollection acquire lock in mongo db
Yes, the collection is available during the process. Actually, that command sh.shardCollection will take only milliseconds to execute, but actual balancing work will take hours or days to be ready. Balancing will not lock collection, it's just moving chunks from one shard to other one.

Just be careful when selecting sharding key, you should have good knowledge of basics of sharding and how it works.