Enclosing code/text elements in the code tag varies user to user. For example, one user put 'decimal' inside the code tag. Then another user edited the post and put it as simple text. Such types of examples are very frequent in Stack Overflow. It is confusing. Is there any guideline about which elements can be put inside the tag within the description?
It's a code tag, not a formatting tag.
If it's code snippets, configuration file snippets or something shown in a console, and requires formatting to be preserved to make sense use code tags. For many languages on sites like SO this also gives you syntax highlighting.
You do not use code blocks to format things - usually. 'You use the
decimal type' and 'You use the decimal type' are functionally similar. However the latter feels more natural. However "Run
foobar.exe /baz" is more readable than "Run foobar.exe /baz".
You might also want to take a look at the edit reasons to get an idea of the editor's reasons. Fundamentally - always pick the clearer more readable format for the content.