Yes, it’s ok to keep just male guppies. Male guppies can live with each other with no problems. In fact, if you don’t want to eventually have baby guppies or fry, you should consider keeping only male guppies.
However, male guppies can sometimes be aggressive with each other. They can chase or fight each other to assert dominance. While this is normal guppy behavior, you’ll still need to keep an eye on them as fighting can sometimes result in injuries.
To minimize aggression between your male guppies, always ensure you give them enough food and provide lots of hiding spaces in the tank.