1.In spite of her thinness, he loves her.
2.In spite of her being thin, he loves her.
Which sentence is grammatical, thin or thinness? I wanted to know whether "thiness" can use for a person's body.
Both of your sentences are correct and understandable and have the same meaning.
The use of the something-ness suffix makes them equivalent often has the meaning of "having the state of something"
thinness = being thin
loudness = being loud
awkwardness = being awkward
openness = begin open
However, it will not work for all adjectives
smartness(more usual would be "being smart")
tallness(more usually would be "being tall")