My salary got increased yesterday is just as grammatical as I got injured yesterday, or the sky got dark or his feelings got hurt, or in 2018, the Quadrennial Defense Review got replaced by the National Defense Strategy. The last example sounds "funny" just as your salary example does for reasons that are related to idiomacity, not grammaticality.
In informal, conversational English, get is sometimes used as a marker of the passive voice, instead of standard auxiliary be. These are sometimes distinguished as the get-passive and be-passive respectively.
The Voice of America Learning English website has a page on "The Passive Voice with 'Get'" which explains that
The verb get can be followed by some adjectives to express the idea of change or becoming something. We use this structure for people and things.…
Get can also be followed by the past participle…. The verb get expresses action so, for this structure, we use it with action verbs. Action verbs express physical or mental action.
Using get places more emphasis on the subject or the nature of the act itself, and often indicates when something is more or less desired or expected than be might indicate. I got fired is a more intense expression than I was fired; it carries a much stronger connotation of an unwanted, unfair, unexpected, etc. dismissal executed by someone else, whereas I was fired is more clinical.
Although get is common in conversational English, it is also avoided in more formal communication on either side of the pond, particularly in writing. The get-passive, furthermore, tends to be used with simple actions as opposed to complex, planned activities.
All this contributes to my salary got increased sounding a bit off. A salary is an abstraction, so it is a little strange to think of a salary obtaining an increase; it is the employee who has obtained the increase. Salary is also a technical term for a specific form of compensation, suggesting a process that is more involved than something you can get increased. If I may suggest a few alternatives:
My salary was increased.
Using the be-passive is unexceptional.
I got my salary increased.
This emphasizes that the increase is attributable to your intervention.
My pay got bumped up.
This uses the more informal pay and bump up which are more congruent with the informal got.
I got a raise.
This is the most idiomatic way to describe the situation in American English. Here, however, get is used in its active sense of obtaining or receiving something.