It is best to ask your doctor or clinic about after care instructions. However, sleeping on your pillow would be safe.
going to sleep and laying on the scar treated wit scalp micropigmentation will not impact the results of a well done job. See web site below