I want to know what the salary ranges are for different levels at my workplace. Is it OK to ask HR that sort of question? Is it common?
I'm curious because a position that is similar to mine was advertised, but with a higher salary.
I'm assuming that this is for the company you currently work for.
Yes, it's OK to ask. But you may not get an answer.
Some companies have a highly structured salary system, where everybody is assigned a grade, depending on the job they do, and there is a defined salary band for that grade. Governments and large companies are usually of this type. It's usually OK (but not always) to know what the salary bands are for different grades. You won't be able to find out what grade any given person is is, but that isn't difficult to deduce. At the very least you should be able to find out the band for your grade.
Some companies don't have anything that structured, in which case everyone's salary might be different, and you will not be able to find out the salary for any position.
This is absolutely an acceptable topic to discuss with either HR or your direct supervisor. Some companies actually publicize (within the company) what the pay range for a particular job is. Some don't. Some allow management to share this information with their staff at their discretion.
There are various ways (salary/statistic websites, friends in the industry, recruiters, job listings) to find out a standard range of salaries for your position in your area. If your company is not willing to discuss what they pay (remember: base salary is only the most basic part of your compensation, and you need to consider the rest of the package) for your skillset and experience, you may want to look elsewhere.
In the past, I've gone to my direct supervisor to ask what the salary range is for my position (and the levels above and below me), and this person was happy to sit down and discuss the topic with me. A healthy workplace will be willing to make it clear to you how they will compensate you and why, and how you can earn more or be promoted (since higher earnings and promotions are directly tied to performance that benefits the employer). I would be hesitant to trust a company that is not willing to discuss how they compensate their employees.
Always keep in mind that salary is just one part of a compensation package. The other position may be in a different sector (where profit margins are higher) or require frequent travel. Maybe they are searching for somebody with special skills, who is more difficult to find. Maybe they need someone urgently, and that is why they are offering higher pay. There are a lot of factors at play here. Before judging your own salary, be sure that you are comparing apples with apples.
Between the lines, your question seems to be "I saw a position similar to mine with higher advertised pay. What do I do with this knowledge?"
There will always be people who are paid more than you are. These people may have worn a shirt in a color the CEO liked on the day of their interview, they may have joined the company at the right moment, or they may have negotiated better. Accept this and move on.
Now, if you feel you deserve more money (based on thorough market research, not just 'a job ad on LinkedIn'), read these excellent questions: