Yes, I have done this before - a few weeks ago, booked an SFO-LAX using miles at ~T-2.5, realized I couldn't make it about 30 minutes later (Etihad refused to issue my connecting AA LAX-BOS ticket within 24 hours, and I had to have them use the miles for the next day's SFO-JFK instead), and then cancelled using the app, getting all the miles back (with taxes refunded to card a few days later).
If you don't anticipate making it to the flight, be sure to cancel it in the app before boarding time - the routing restrictions usually say something to the effect of "cancel by departure time or no value."