While you can paint over a peeling wall, we wouldn't recommend it.  That's because newly applied paint is likely to flake and peel off pretty quickly.  For a long lasting finish, it's better to prepare the wall properly first by sanding away loose, peeling paint and filling any deep scratches prior to painting.