The law about killing squirrels varies from country to country and state to state. Read more about what the law says in your area, ignorance cannot be used as a defense.
In many countries & states, it’s legal to kill rats. However different rules apply to the methods you can use. Read this article to learn more.
Mouse bait stations are very good if you want to use poison to get rid of your mouse pest. It keeps the poison contained in a secure trap so pets and children do not have access to it.