It is not illegal, but it is not necessary. One elevator per household is equivalent to the elevator directly entering the home, and the access card is brushed one by one, which plays a protective role.
The stairwell is a part of the owner and a fire escape. Unauthorized occupation is not allowed. Installing a security door at the elevator entrance may involve occupying public passages, which violates the relevant regulations on fire control.