Yes you can replace the existing breaker.......
......IF THE BOX ALLOWS IT !.....Read the fine print on the box cover or post the make and model of the panel...........
SlimLine breakers are safe if installed correctly......Usually only certain locations in the panel can accept the slims........You may need to move some breakers around to complete the project...........