As has been mentioned, it depends on the exchange. If it is a ITCH feed, you can see your order in the updates and you'll know your exact position in the queue. That is not the case for all exchanges. CME, for example, uses an aggregated limit order book, meaning that you see only the number of orders and size at each price level. As a market maker, you will likely want to compute your expected position in the queue. This is nontrivial, and something that pretty much any HFT would consider proprietary information. Here are some clues:
1. Since the number of orders and size is (in theory...) updated for each order, you know your upper bound on queue position when you enter the order.
2. Your task is to decide if decreases in the size variable (cancellations) come from in front of or behind you in the queue after you place your order.
3. Given that you can see the quote accumulation process taking place for the nearest 10 levels in the book, you can also maintain a queue (for FIFO matching products) of all the order sizes and corresponding numbers of orders between when a price level comes into view and when it leaves your view. You're out of luck on the resting orders that are there as soon as a level comes into view.
4. Given the above queue, you know the order sizes of each order that took place between the price level coming into the sliding ten level window and now. If an order is either notably large or has a unique size among the orders in the list (which is usually an assumption because there will be resting orders you know nothing about), you can do fairly well ascertaining where in the queue it came from by matching up the sizes and changes in the number of orders variable. There are cases where this isn't true.
5. However you choose to construct your estimate of queue position, there's of course an easy if costly way to test it: come up with an estimator, put down some one lot limit orders and compare your estimate to when you get filled.