Whether you can dye your bikini or swimsuit with fabric dye depends on the fabric. This information can be found on the label of your swimwear. If your bikini is made of polyester or a highly water repellent material, the coloring will not work. For most other fabrics you should get good results. However, prints will always be visible and the stitching wont take on color.
To get an idea of the result, you can cut out a small piece of fabric (for example from a string or from the inside) and test it first in the fabric dye.