No, it is not dangerous to get vaccines when ill.
Remember that vaccines work by generating an immune response. The immune system needs to respond to the vaccine. If that immune system is very busy - such as fighting a serious infection, then it might not create a strong enough response. So only when seriously ill, shots may just not work as well. They do fine with mild and moderate infection.