I am putting in a dishwasher and I have a dedicated 20A circuit (12/2, 20A breaker).
I have 15A outlet handy.
Is it okay to install it in this application?
You can use a 15A duplex, but not a single outlet. [NEC 210.21(B)(1) and (3)].
Edit: Sorry my answer was initially incomplete, only answering specifically what was asked. Many additional Code requirements still apply. GFCI protection (breaker, device, or receptacle) is likely required, see code references in comments to other answer.
Your added picture shows you mounted receptacle with only center screw, 406.5(C) requires receptacles mounted on covers to be mounted by more than one screw.
Also worth mentioning since the ground screw hole was empty in the first picture that the equipment ground needs to be pigtailed to the box and receptacle so both remain grounded when the cover is removed.
It does look like you are probably satisfying the 422.16(B)(2)(6) requirement that the receptacle for the DW must be in the cabinet adjacent to the DW.
A 15A duplex receptacle, as noted an another answer, is 100% fine. However, there may be a GFCI requirement, depending on your local code. If GFCI is required and your breaker has GFCI, you are all set. If GFCI is required and your breaker does not have GFCI then you will need to replace the breaker or install a GFCI receptacle (duplex 15A, duplex 20A or single 20A) here.