You can't use AT commands in a MIDlet: AT commands should be sent to the phone over a serial connection from e.g. a PC.
Only two Nokia phones currently allow you to send and receive SMS messages in a MIDlet:
The Nokia 3650 (Symbian GSM camera phone) implements the Wireless Messaging API (
http://www.jcp.org/en/jsr/detail?id=120).
Early versions of the Nokia 3410 (low-end GSM phone) support Nokia's proprietary "Nokia SMS API", which is almost identical to the Wireless Messaging API. Later versions of the Nokia 3410 support both the Nokia SMS API and the standard Wireless Messaging API.
No other Nokia phones (so far) support either of these APIs.
Both the Wireless Messaging API and the Nokia SMS API are illustrated in Forum Nokia's example "A MIDlet Example Using the Wireless Messaging API and the Nokia SMS API: Chat v1.0" (see their "Java Code and Examples" section). Forum Nokia is at:
http://www.forum.nokia.com/java I know much less about other manufacturers' phones. I'm not aware of any that support the standard Wireless Messaging API, but I know that some manufacturers had their own proprietary SMS APIs.