It sounds ok really , but might feel more natural as: It is more dangerous to swim in the river than in the pool. It is safer to swim in the pool than the river. I think it is the 'swimming is more dangerous' that sounds a little odd, but I don't think it is actually incorrect.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.