What I mean is could you put some mines, in a stars gravity well, or the uncolonizeable asteroid fields?
It depends on the race you're using. Advent and Vasari can put mines in any available gravity well (using their strike craft or mine laying frigate, respectively). TEC can only use the constructor craft to build mines, so they're limited to making mines in the gravity wells of planets they own.
What about starbases can they go anywhere?
Pretty much. 1 star base per player per gravity well (stars are an exception - they allow 4 per...). Also, I think Magnetic Clouds might screw up the starbase constructors, but I'm not 100% sure.