How does the stack work for the item "Device"?
Yes, you can discard Device after rolling.

You don't have to declare any sort of intention about your attack; stealing isn't something you "attempt" to do. When you attack, if you inflict 2 or more points of physical damage, then you can choose to steal an item instead of doing the damage. You don't have to declare before you roll whether you are trying to steal or not. Stealing is an option you have if you roll high enough.

Simply read literally, Device seems to imply that you can use it after rolling. It simply says "discard this card to add 3 to your attack roll". It doesn't give a restriction on when you can do that. So I make the attack roll, and then I can use Device if I want.

Although the wording on Device by itself does not make it completely clear if you need to discard it before or after rolling, we can look at other items to get an answer. Adrenaline Shot says "Before you attempt a trait roll you can use this item to add 4 to the result of that roll." So it specifies that it must be used before attempting the roll. It is a safe assumption that if Device intended you to have to use it before the tole, then it would have similar wording.