Q:

Find all entities by given rank

I am trying to understand ranking functions in T-SQL, but I am not sure I do.  I am practising DENSE_RANK() and having troubles with understanding what's happening here: 
SELECT 
   EmployeeID,
   FirstName,
   LastName,
   Salary,
   DENSE_RANK() OVER
   (PARTITION BY Salary ORDER BY EmployeeID) AS Rank
FROM  Employees
WHERE Salary BETWEEN 10000 AND 50000
ORDER BY Salary DESC

Why columns with equal salaries have a different rank? 

The rows within a partition that have the same values will receive the same rank.  

My next question is if it's possible to find only the entities whose Rank is 2?  

A:

The behaviour is correct.  You are creating a group based on salary and then order by employee id
I guess you want:
DENSE_RANK() OVER(ORDER BY Salary DESC) AS Rank

To filter rows you need to use inline view/cte:
WITH cte AS (
SELECT 
   EmployeeID,
   FirstName,
   LastName,
   Salary,
   DENSE_RANK() OVER(ORDER BY Salary DESC) AS Rank
FROM  Employees
WHERE Salary BETWEEN 10000 AND 50000
)
SELECT *
FROM cte
WHERE Rank = 2
ORDER BY Salary DESC

EDIT:

Why columns with equal salaries have a different rank? 

The issue is that you partitioned data based on salary.  Salaries with the same value are in single group.  Now for that group ordering is performed by using employee_id column which is different per employee. 
Without PARTITION BY the entire dataset is single partition and ranks are based on descending salary value.